Jump to content

ERROR in Cannot find module 'node-sass' while running “npm run watch”?


Recommended Posts

Environment:

Windows 10

Prestashop 1.7

node v12.15.0

I am following a tutorial to create a prestashop theme. It uses sass & npm to compile the theme.css from theme.scss.

When I run:

npm run watch

I get this error message:

ERROR in Cannot find module 'node-sass'

So I searched for a solution and I had to run this command:

npm install -g node-sass

in order to install the proper version. But it didn't change anything. The command "npm run watch" is still showing an error about "node-sass not installed".

On screenshot you can see the successful installation of node-sass: 

On screenshot can see "node-sass" in the package.json: 

On screenshot you can see the error: 

WHAT I TRIED :

I tried different command to rebuild, reinstall and other stuff without any success:

npm rebuild node-sass npm install -g --safe-dev --unsafe-perm node-sass

I still have the same issue.

So what can I do?

node_sass_issue.png

package_json.png

node1.png

Link to comment
Share on other sites

1 hour ago, Nino59 said:

Environment:

Windows 10

Prestashop 1.7

node v12.15.0

I am following a tutorial to create a prestashop theme. It uses sass & npm to compile the theme.css from theme.scss.

When I run:

npm run watch

I get this error message:

ERROR in Cannot find module 'node-sass'

So I searched for a solution and I had to run this command:

npm install -g node-sass

in order to install the proper version. But it didn't change anything. The command "npm run watch" is still showing an error about "node-sass not installed".

On screenshot you can see the successful installation of node-sass: 

On screenshot can see "node-sass" in the package.json: 

On screenshot you can see the error: 

WHAT I TRIED :

I tried different command to rebuild, reinstall and other stuff without any success:

npm rebuild node-sass npm install -g --safe-dev --unsafe-perm node-sass

I still have the same issue.

So what can I do?

node_sass_issue.png

package_json.png

node1.png

Try with:

sudo npm install --save-dev --unsafe-perm node-sass

 

Link to comment
Share on other sites

Thanks for your help.

I did run "npm install --save-dev --unsafe-perm node-sass" as admin and I didn't see any error message.

 

But when I go to _dev folder and run "npm install", I still get the error 404 about node-sass

 

 

nodeissue2.png

nodeisssue1.png

Link to comment
Share on other sites

16 hours ago, Nino59 said:

Thanks for your help.

I did run "npm install --save-dev --unsafe-perm node-sass" as admin and I didn't see any error message.

 

But when I go to _dev folder and run "npm install", I still get the error 404 about node-sass

 

 

nodeissue2.png

nodeisssue1.png

You can only use a certain node-sass version range with a specific Node.Js version.

So if you're you are using Node 12 - you must update to [email protected] etc

This should get rid of the errors.

This is explained in the repos FAQ:

https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#404s

 

Either try with:

Quote

npm install -g npm@latest

 

Link to comment
Share on other sites

You can only use a certain node-sass version range with a specific Node.Js version.

So if you're you are using Node 12 - you must update to [email protected] etc

This should get rid of the errors.

This is explained in the repos FAQ:

https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#404s

 

Either try with:

Quote

npm install -g npm@latest

 

Edited by ComGrafPL (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...