Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
792 views
in Technique[技术] by (71.8m points)

node.js - Unsupported platform for [email protected]: wanted {"os":"linux","arch":"any"}

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 [email protected]: 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"
  },
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...