【发布时间】:2019-05-26 18:23:42
【问题描述】:
我正在尝试在命令行中运行 create-react-app,但我不断收到以下消息:
“您使用的是 npm 2.15.12,因此该项目将使用旧的不受支持的工具版本进行增强。”
我跑了
sudo npm install npm@latest -g
确保我拥有最新版本的 npm(我还尝试了“sudo npm install -g npm”)。当我跑步时
npm -v
输出是“6.4.1”
我在 create-react-app 过程中遇到了一些错误,但应用程序本身似乎工作正常,“npm start”工作正常,所有文件似乎都在正确的位置,但我不想要以后会遇到更多错误。
经过几个小时的搜索,我找不到使用错误版本的 npm 的 create-react-app 的任何其他问题。有没有办法在使用 create-react-app 时更改正在使用的 npm 版本?
下面的隐藏代码 sn-p 列出了我在 create-react-app 期间遇到的错误。我觉得他们可能是由于使用了过时的 npm 版本。
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.17/fse-v1.0.17-node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.0.17 and node@11.0.0 (node-v67 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.17/fse-v1.0.17-node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.0.17 and node@11.0.0 (node-v67 ABI) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/myuser/node_modules/npm/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! node -v v11.0.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute
【问题讨论】:
标签: node.js reactjs npm create-react-app