Sp-dev-docs: gulp error : Error: Cannot find module '@microsoft/sp-build-web'

Created on 18 Aug 2016  路  11Comments  路  Source: SharePoint/sp-dev-docs

E:myfolder>gulp serve
module.js:327
throw err;
^

Error: Cannot find module '@microsoft/sp-build-web'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (E:shlokhelloworld-webpartgulpfile.js:4:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)

tooling bug-suspected

Most helpful comment

There are a few things missing if you don't have python installed correctly - you will probably find error messages if you scroll far enough back but you can easily miss them. Having got to this stage it may be easier to fix the missing dependencies:

npm install --save-dev @microsoft/sp-build-web

Failing that, make sure you have everything mentioned under "Set up your machine", delete the old helloworld-webpart folder and then create a new one and use Yeoman to re-create everything.

All 11 comments

Same here

Can you test running the following. Looks like there several similar issues with packages not loading properly.

npm install

There are a few things missing if you don't have python installed correctly - you will probably find error messages if you scroll far enough back but you can easily miss them. Having got to this stage it may be easier to fix the missing dependencies:

npm install --save-dev @microsoft/sp-build-web

Failing that, make sure you have everything mentioned under "Set up your machine", delete the old helloworld-webpart folder and then create a new one and use Yeoman to re-create everything.

Thanks @SPDoctor. I have installed Python and again tried to run the package using YO. It worked perfectly.

same here on ubuntu

Hi

Have you tried the following :-
npm -g install npm@next
npm install --global --production windows-build-tools

then try your command again.
Regards

Nigel

I have got the same error while running the gulp trust-dev-cert
Run the command
npm install --save-dev

Solved the issue. That's @ SPDoctor.

Running this command solved the issue for me!
npm i

I have installed python but still recieving error after running npm i

Hi,
We will get this error when the module 'sp-build-web' is missing in "node_modules/@microsoft" folder
install sp-build-web module to resolve this issue
command to install : npm install @microsoft/sp-build-web

SP-Bulid-Web

Also for SPFX make sure that your node js version is >=8.9.4 <9.0.0 || >=10.13.0 <11.0.0

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

waldekmastykarz picture waldekmastykarz  路  3Comments

zerovectorspace picture zerovectorspace  路  3Comments

bengtmoss picture bengtmoss  路  3Comments

mikeparkie picture mikeparkie  路  3Comments

jonthenerd picture jonthenerd  路  3Comments