23

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"
  },
0

2 Answers 2

59

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.

3
  • 7
    had the same typo and I guess many people come in here for the same reason, haha ! Thanks, Ryan ! Jan 29, 2017 at 6:36
  • 4
    i had a different typo: --save=dev Jan 23, 2019 at 22:06
  • hah, my typo is even more funny "npm i dev" instead of "npm run dev" :)
    – Sergey_T
    Jun 10, 2022 at 10:46
3

You unintentionally tried to install dev package https://www.npmjs.com/package/dev that is not supported on your OS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.