[英]ReactJS + NodeJS: What is error “Pass --update-binary to reinstall or --build-from-source to recompile”?
I transferred a ReactJS + NodeJS project from another computer to a new computer. 我将ReactJS + NodeJS项目从另一台计算机转移到一台新计算机。 Then inside the folder, I did
npm install
in the terminal but getting the following response back. 然后在文件夹中,我在终端中进行了
npm install
,但得到了以下响应。
> fsevents@1.0.14 install /Users/Joshua/Projects/practice_project/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/Joshua/Projects/practice_project/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
And on the previous computer, I ran the project via npm run server
, but when I do it after npm run server
in the project on the new computer, now I am getting: 在之前的计算机上,我通过
npm run server
项目,但是当我在新计算机上的项目npm run server
之后执行它时,现在我得到:
> practice_project@1.0.0 serve /Users/Joshua/Projects/practice_project
> nodemon server/server.js --ignore components
sh: nodemon: command not found
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
npm ERR! node v4.6.1
npm ERR! npm v2.15.9
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! practice_project@1.0.0 serve: `nodemon server/server.js --ignore components`
npm ERR! spawn ENOENT
I looked around but can't seem to find the right solution. 我环顾四周但似乎找不到合适的解决方案。 Tried
npm install -g node-gyp
but getting tar.unpack untar error
. 试过
npm install -g node-gyp
tar.unpack untar error
但得到tar.unpack untar error
。
What could be the issue? 可能是什么问题? Will upvote and accept the answer.
将upvote并接受答案。 Thank you.
谢谢。
In this case, the first message you received is just telling you it's attempting to rebuild the fsevents
package for your environment, then realized it already had it built, so stopped the process. 在这种情况下,您收到的第一条消息只是告诉您它正在尝试为您的环境重建
fsevents
包,然后意识到它已经构建了它,因此停止了该过程。
The second message is indicating that you are attempting to run nodemon
but it isn't installed. 第二条消息表明您正在尝试运行
nodemon
但未安装。 I would hazard a guess that it was installed globally on your previous machine (and therefore not included in the project's package.json
). 我猜测它是全局安装在你以前的机器上(因此没有包含在项目的
package.json
)。 If you want to install it globally again, you'll need to run npm i -g nodemon
. 如果要再次全局安装它,则需要运行
npm i -g nodemon
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.