corbt / agent.exe

MIT License
497 stars 36 forks source link

npm install on mac m2 fails #4

Closed DenisSergeevitch closed 1 hour ago

DenisSergeevitch commented 2 hours ago

By default it returns an error:

(base) ➜  agent.exe git:(main) npm install
npm error Invalid property "node"

To resolve it we need to update package.json:

"Invalid property 'node'" is caused by the presence of the "devEngines" field in package.json. This field is not supported in modern versions of npm, which is why I get error with npm 10.9.0.

Here is a quick fix for people who has the same error:

Open package.json and edit line 239:

Before:

"devEngines": {
    "node": ">=14.x",
    "npm": ">=7.x"
}

After:

"engines": {
    "node": ">=14.x",
    "npm": ">=7.x"
}

Now npm install will work

corbt commented 2 hours ago

Weird this does work on my m2 mac. I think devEngines is in fact a supported field? https://docs.npmjs.com/cli/v10/configuring-npm/package-json#devengines

1n1n1t3 commented 2 hours ago

same happens on Windows. Had to manually change devEngines to engines

brianjking commented 1 hour ago

I had to do this as well, M1 Mac with Sequoia.

developerfred commented 1 hour ago

By default it returns an error:

(base) ➜  agent.exe git:(main) npm install
npm error Invalid property "node"

To resolve it we need to update package.json:

"Invalid property 'node'" is caused by the presence of the "devEngines" field in package.json. This field is not supported in modern versions of npm, which is why I get error with npm 10.9.0.

Here is a quick fix for people who has the same error:

Open package.json and edit line 239:

Before:

"devEngines": {
    "node": ">=14.x",
    "npm": ">=7.x"
}

After:

"engines": {
    "node": ">=14.x",
    "npm": ">=7.x"
}

Now npm install will work

use nvm to control node version

corbt commented 1 hour ago

Ok seems like this is a common issue, I just pushed an update that should fix!