Unsupported platform for inotify@1.4.1: wanted {“os”:“linux”,“arch”:“any”}

匿名 (未验证) 提交于 2019-12-03 01:20:02

问题:

I am coming across a very bizarre error when installing packages for my webpack/reactjs application.

I am currently trying to install

npm install copy-webpack-plugin --save dev

The build/start scripts fail and the following error is shown in the terminal:

Unsupported platform for inotify@1.4.1: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"}) 

This means absolutely noting to me and I cannot find any clear explanations online.I do not know why inotify is needed or when/where it has been installed.

Package.json scripts:

  "scripts": {     "start": "node server.js",     "build": "cross-env BABEL_ENV=production ./node_modules/.bin/webpack --config webpack.config.production.js",     "lint": "eslint --cache --ignore-path .gitignore --format=node_modules/eslint-formatter-pretty . *.js",     "test": "npm run lint"   }, 

回答1:

There is a typo in your command:

npm install copy-webpack-plugin --save dev 

Should be:

npm install copy-webpack-plugin --save-dev 

(You forgot a dash)

The typo will make npm try to install https://www.npmjs.com/package/dev, which depends on inotify.

Your error message is because inotify only works on Linux and you are on a Mac.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!