0

I am new to SpFx and this might be very much basic question.

I have followed instruction mentioned in below page and when I ran "gulp serve" command I got an error which says "Local gulp not found"

https://github.com/SharePoint/sp-dev-fx-webparts

Below is output from the console

C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials>gulp -v
[21:08:39] CLI version 3.9.1

C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials>npm -v
5.6.0

C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials>gulp serve
[21:08:49] Local gulp not found in C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials

[21:08:49] Try running: npm install gulp

C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials>

EDIT

Quick update on this

I did not navigate to the specific tutorial folder. I navigate to below folder and then ran "npm install" which gave me below output

\sp-dev-fx-webparts\tutorials\tutorial-getting-started\hello-world-sp

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Ravi\PnP\Code\sp-dev-fx-webp
arts\tutorials\tutorial-getting-started\hello-world-sp\node_modules\node-gyp\lib
\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Ravi\PnP\Code\sp-dev-fx-webpa
rts\tutorials\tutorial-getting-started\hello-world-sp\node_modules\node-gyp\lib\
configure.js:508:16)
gyp ERR! stack     at C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials\tutorial-get
ting-started\hello-world-sp\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Ravi\\PnP\\Code\\sp-
dev-fx-webparts\\tutorials\\tutorial-getting-started\\hello-world-sp\\node_modul
es\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsas
s_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials\tutorial-getting-star
ted\hello-world-sp\node_modules\node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ravi\AppData\Roaming\npm-cache\_logs\2018-06-07T01_23_
59_699Z-debug.log

"gulp serve" gave me below error.

C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials\tutorial-getting-started\hello-wor
ld-sp>gulp serve
module.js:540
    throw err;
    ^

Error: Cannot find module '@microsoft/sp-build-web'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Ravi\PnP\Code\sp-dev-fx-webparts\tutorials\tutoria
l-getting-started\hello-world-sp\gulpfile.js:4:15)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)

EDIT

After looking at output of npm install again and again I found few errors regarding Python and thankfully got below thread where I ran below commands which fix the npm and gulp command issue.

https://stackoverflow.com/questions/15126050/running-python-on-windows-for-node-js-dependencies

npm install --global --production windows-build-tools

npm install --global node-gyp

When I ran the gulp command it opens up windows explorer with "https://localhost:4321/temp/workbench.html"

But it gave me "This page can’t be displayed" error and not sure how can I proceed.

EDIT

So finally I was able to solve my issue,

I followed two steps in order to fix the issue,

Run below command gulp trust-dev-cert Edit server.json file to point to http://

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.