Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular CLI 1.7.4 does not support NodeJS 10 #10527

Closed
aJ5fa1JGN1FatBw6Fa0md5RrVBEk2G opened this issue Apr 29, 2018 · 8 comments
Closed

Angular CLI 1.7.4 does not support NodeJS 10 #10527

aJ5fa1JGN1FatBw6Fa0md5RrVBEk2G opened this issue Apr 29, 2018 · 8 comments

Comments

@aJ5fa1JGN1FatBw6Fa0md5RrVBEk2G

Versions

Node 10.0.0
NPM 6.0.0
Windows 10

Repro steps

Install the latest NodeJS 10, the latest NPM 6 with Angular 1.7.4

Observed behavior

When trying to run ng serve on an angular 1.7.4 project it fails because
Angular 1.7.4 uses node-sass 4.8.3
Node-sass 4.8.3 only supports up to NodeJS 9
See:
https://github.com/sass/node-sass/releases/tag/v4.8.3

Desired behavior

Update Angular 1.7.4 to support NodeJS by upgrading node-sass to v4.9.0
Node-sass 4.9.0 supports up to NodeJS 10.
See:
https://github.com/sass/node-sass/releases/tag/v4.9.0

@akaustav
Copy link

akaustav commented May 6, 2018

Found a similar problem when I was following the During the update checklist generated by the Angular Update Guide for upgrading from Angular 5.2 to Angular 6.0. This problem occurred for me when trying to use the ng update @angular/cli command.

image

My Versions

Node 10.0.0
NPM 5.6.0 (I didn't realize there is a 6.0.0 already)
Windows 10

Temporary Workaround

  1. Download and save a local copy of the correct version of node-sass binary - win32-x64-64_binding.node. For example download it to the following location:
    C:\node-sass\win32-x64-64_binding.node
  2. Provide reference to the full path of the node-sass binary file in the sass_binary_path npm configuration parameter (in the ~/.npmrc file):
    npm config set sass_binary_path <path to node-sass binary>
    For example,
    npm config set sass_binary_path C:\node-sass\win32-x64-64_binding.node
  3. Run the npm install command again to install @angular/cli correctly.
  4. Execute ng serve or npm start and your should be past the problem.

Explanation of the Workaround

  1. The NODE_MODULE_VERSION of Node 10.0.0 is 64. See their previous releases page for a detailed table. More explanation at the footer of that page.
  2. I understood it was looking for win32-x64-64_binding.node inside the node-sass 4.8.3 folder.
  3. node-sass 4.8.3 doesn't have a node-sass binary compiled with the NODE_MODULE_VERSION set to 64. Hence, it fails downloading.
  4. However, node-sass 4.9.0 has a node-sass binary compiled with the NODE_MODULE_VERSION set to 64. Hence, that binary will do.

@SimonKomlos
Copy link

SimonKomlos commented May 27, 2018

@akaustav I tried following your suggestion for the temporary workaround but it caused a huge issue with my node-sass .. you can read more here if you want: sass/node-sass#2397

Do you know how I can revert the config changes you suggested?

After trying npm install I get:

Binary found at C:node-sasswin32-x64-64_binding.node
Testing binary
Binary has a problem: { Error: Cannot find module 'C:node-sasswin32-x64-64_binding.node

and

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.7.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Any ideas?

@akaustav
Copy link

akaustav commented May 28, 2018

Hi @SimonKomlos
Apologies, I am not in front of a computer at the moment. But if you've still not figured it out by now, perhaps you've mixed up the backslashes ( \ ) on Windows. Do you mind pasting the contents of the %USERPROFILE%.npmrc file here?

Reason: I don't see backslashes on your output.

Binary found at C:node-sasswin32-x64-64_binding.node

I expected to see something like this:

Binary found at C:\node-sass\win32-x64-64_binding.node

I can paste the precise output lines which I receive in my PC when I am in front of my PC.

@SimonKomlos
Copy link

@akaustav thanks for replying. My .npmrc files content is

sass_binary_path=C:node-sasswin32-x64-64_binding.node

It does look like it missed the /.. I ended up deleting my C:/node-sass folder after I reinstalled node, but I guess it's still looking for it now. Do you think I should follow your workaround again.. correctly this time, or should I reset it? I'm not sure how I would reset it though.

I appreciate you replying :)

@SimonKomlos
Copy link

@akaustav so I changed the directory for as you suggested, and I still seem to have issues:

$ npm install node-sass@4.7.2 --save-dev
npm WARN angularfire2@5.0.0-rc.10 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.10 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.10 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.10 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.10 requires a peer of firebase@^5.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.10 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN geofire@4.1.2 requires a peer of firebase@^2.4.0 || 3.x.x but none is installed. You must install peer dependencies yourself.

npm ERR! path C:\xampp\htdocs\project x\projectx\node_modules\npm\node_modules\dezalgo\node_modules\asap
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\xampp\htdocs\project x\projectx\node_modules\npm\node_modules\dezalgo\node_modules\asap' -> 'C:\xampp\htdocs\project x\projectx\node_modules\npm\node_modules\dezalgo\node_modules\.asap.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Simon K\AppData\Roaming\npm-cache\_logs\2018-05-29T15_37_41_518Z-debug.log

and

$ npm ls node-sass
projectx@0.0.1 C:\xampp\htdocs\project x\projectx
`-- UNMET DEPENDENCY node-sass@4.7.2

npm ERR! missing: node-sass@4.7.2, required by projectx@0.0.1

Any ideas?

@akaustav
Copy link

akaustav commented Jun 6, 2018

Hi @SimonKomlos, I am not sure node-sass is necessary to be installed at the root of your project - not even as a dev dependency. It's a sub-dependency of @angular/cli.

Perhaps your global @angular/cli installation may be corrupt. Try uninstalling it by issuing npm -g uninstall @angular/cli. And re-install by issuing: npm -g install @angular/cli.

After that, ensure your current node_modules folder isn't corrupt. You probably want to start by deleting your node_modules folder and perform an npm install. If that doesn't help, you might as well start a new project using ng new projectx.

@alan-agius4
Copy link
Collaborator

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants