boilerplate-advancednode: `npm i` fails on Apple Silicon because of incompatible Node version
See original GitHub issueNote: I’m opening this issue here as it doesn’t seem to be possible to open issues on the boilerplate-advancednode
repository.
Affected page
https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/set-up-a-template-engine https://github.com/freeCodeCamp/boilerplate-advancednode/
Your code
Running npm i
on an Apple Silicon Mac results in the following error:
npm ERR! code 1
npm ERR! path /Users/ce-dev/Documents/dev/courses/freecodecamp-projects/06 Quality Assurance/boilerplate-advancednode/node_modules/node
npm ERR! command failed
npm ERR! command sh -c node installArchSpecificPackage
npm ERR! npm ERR! code ETARGET
npm ERR! npm ERR! notarget No matching version found for node-darwin-arm64@12.18.0.
npm ERR! npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! npm ERR! notarget a package version that doesn't exist.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /Users/ce-dev/.npm/_logs/2022-01-21T14_43_20_296Z-debug.log
npm ERR! node:internal/modules/cjs/loader:936
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'node-darwin-arm64/package.json'
npm ERR! Require stack:
npm ERR! - /Users/ce-dev/Documents/dev/courses/freecodecamp-projects/06 Quality Assurance/boilerplate-advancednode/node_modules/node/installArchSpecificPackage.js
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:108:19)
npm ERR! at ChildProcess.<anonymous> (/Users/ce-dev/Documents/dev/courses/freecodecamp-projects/06 Quality Assurance/boilerplate-advancednode/node_modules/node-bin-setup/index.js:18:27)
npm ERR! at ChildProcess.emit (node:events:390:28)
npm ERR! at maybeClose (node:internal/child_process:1064:16)
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: [
npm ERR! '/Users/ce-dev/Documents/dev/courses/freecodecamp-projects/06 Quality Assurance/boilerplate-advancednode/node_modules/node/installArchSpecificPackage.js'
npm ERR! ]
npm ERR! }
This is because node@12.18.0
, which is listed as a dependency, does not run on Apple Silicon.
Expected behavior
Users should be able to install dependencies.
System
- Device: MacBook Air M1
- OS: MacOS 12.1
- Browser: n/a
Additional context
Changing the dependencies to the following fixes the problem.
"dependencies": {
"dotenv": "^8.2.0",
"express": "^4.16.1",
"mongodb": "^3.6.1",
"node": "^17.3.1"
},
Everything still seems to work as I was able to pass the first challenge (“Set up a Template Engine”) with these packages, but I have not done any testing beyond “seems to works on my system and on Heroku”.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
To be honest, I’m not sure why we have node as a dependency. That’s not how I ever set a node version in practice. I vote we remove that.
It’s useful to recommend compatible node versions (i.e. use
engines
), but only if we test them to make sure that’s true. We can defer that until we set up testing for the boilerplates - otherwise it’s just annoying and misleading. So, to qualify my previous statement:engines
seems useful if we’re running tests.For now, I’d be fine with just deleting
node
from the dependencies.Wanted to confirm the dependency wasn’t present in other boilerplates before closing. Think we’re good to go now.