新 Mac 上的 NPM,带有从我以前的 Linux 系统传输的文件.在 VS 代码终端上启动 npm 的问题



嘿,人们...将一些工作JS文件从旧Linux转移到我的新MacBook Air。尝试在 vs 代码终端中使用 NPM start 启动我的文件时,我收到此错误:(请帮助!

Galias-MacBook-Air:react-nextagram Guy$ npm start
react-nextagram@0.1.0 start /Users/Guy/Desktop/Next Academy/react-nextagram
react-scripts start
sh: /Users/Guy/Desktop/Next Academy/react-nextagram/node_modules/.bin/react-scripts: cannot execute binary file
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! react-nextagram@0.1.0 start: `react-scripts start`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the react-nextagram@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Guy/.npm/_logs/2019-01-24T01_15_13_056Z-debug.log
Galias-MacBook-Air:react-nextagram Guy$

我也是。我从 Ubuntu 18.04 迁移到 OSX Catalina。这就是我解决的方式:

删除node_modules并npm installnpm install -s问题出在您的node_modules内部

这里的问题是你已经编译了依赖项。您在应用程序上使用的一个或多个包需要针对要在其中运行它们的操作系统进行编译。要解决此问题,您可以尝试以下选项之一:

这将针对您当前的操作系统重建所有内容。

npm rebuild

您可以进行全新安装。

rm -rf node_modules && npm install

最新更新