Possible Problems with sp-pnp-js packaging

%3CLINGO-SUB%20id%3D%22lingo-sub-9197%22%20slang%3D%22en-US%22%3EPossible%20Problems%20with%20sp-pnp-js%20packaging%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-9197%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20been%20trying%20to%20get%20%40SPDoctor's%20SiteInfo%20web%20part%20working%20with%20SPFx%20framework.%26nbsp%3B%20One%20of%20the%20dependencies%20is%20sp-pnp-js.%26nbsp%3B%20I%20get%20failures%20when%20I%20try%20and%20compile%20the%20webpart%20with%20gulp%20serve%20%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E'typings'%20is%20not%20recognized%20as%20an%20internal%20or%20external%20command%2C%3CBR%20%2F%3Eoperable%20program%20or%20batch%20file.%3CBR%20%2F%3Enpm%20ERR!%20Windows_NT%2010.0.14915%3CBR%20%2F%3Enpm%20ERR!%20argv%20%22C%3A%5C%5CProgram%20Files%5C%5Cnodejs%5C%5Cnode.exe%22%20%22C%3A%5C%5CXXXX%5C%5CYYYY%5C%5CZZZZ%5C%5CAppData%5C%5CRoaming%5C%5Cnpm%5C%5Cnode_modules%5C%5Cnpm%5C%5Cbin%5C%5Cnpm-cli.js%22%20%22install%22%20%22-g%22%20%22sp-pnp-js%22%20%22--save%22%3CBR%20%2F%3Enpm%20ERR!%20node%20v4.5.0%3CBR%20%2F%3Enpm%20ERR!%20npm%26nbsp%3B%20v3.10.7%3CBR%20%2F%3Enpm%20ERR!%20code%20ELIFECYCLE%3C%2FP%3E%3CP%3Enpm%20ERR!%20sp-pnp-js%401.0.4%20postinstall%3A%20%60typings%20install%60%3CBR%20%2F%3Enpm%20ERR!%20Exit%20status%201%3CBR%20%2F%3Enpm%20ERR!%3CBR%20%2F%3Enpm%20ERR!%20Failed%20at%20the%20sp-pnp-js%401.0.4%20postinstall%20script%20'typings%20install'.%3CBR%20%2F%3Enpm%20ERR!%20Make%20sure%20you%20have%20the%20latest%20version%20of%20node.js%20and%20npm%20installed.%3CBR%20%2F%3Enpm%20ERR!%20If%20you%20do%2C%20this%20is%20most%20likely%20a%20problem%20with%20the%20sp-pnp-js%20package%2C%3CBR%20%2F%3Enpm%20ERR!%20not%20with%20npm%20itself.%3CBR%20%2F%3Enpm%20ERR!%20Tell%20the%20author%20that%20this%20fails%20on%20your%20system%3A%3CBR%20%2F%3Enpm%20ERR!%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20typings%20install%3CBR%20%2F%3Enpm%20ERR!%20You%20can%20get%20information%20on%20how%20to%20open%20an%20issue%20for%20this%20project%20with%3A%3CBR%20%2F%3Enpm%20ERR!%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20npm%20bugs%20sp-pnp-js%3CBR%20%2F%3Enpm%20ERR!%20Or%20if%20that%20isn't%20available%2C%20you%20can%20get%20their%20info%20via%3A%3CBR%20%2F%3Enpm%20ERR!%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20npm%20owner%20ls%20sp-pnp-js%3CBR%20%2F%3Enpm%20ERR!%20There%20is%20likely%20additional%20logging%20output%20above.%3C%2FP%3E%3CP%3Enpm%20ERR!%20Please%20include%20the%20following%20file%20with%20any%20support%20request%3A%3CBR%20%2F%3Enpm%20ERR!%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20C%3A%5CXXXX%5CYYYY%5CZZZZ%5CDocuments%5CSPFx%5CProjects%5Cnpm-debug.log%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnybody%20Ideas%20%3F%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENigel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-20272%22%20slang%3D%22en-US%22%3ERe%3A%20Possible%20Problems%20with%20sp-pnp-js%20packaging%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-20272%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20worst%20scenario%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3Enpm%20cache%20clean%0Anpm%20install%20typings%20-g%0Anpm%20install%20sp-pnp-js%20--save%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-9283%22%20slang%3D%22en-US%22%3ERe%3A%20Possible%20Problems%20with%20sp-pnp-js%20packaging%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-9283%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20finally%20got%20this%20to%20work%20by%20doing%20the%20following%20%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Enpm%20install%20typings%20-g%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhich%20fixed%20the%20first%20problem%20and%20the%20I%20got%20%22cannot%20find%20module%26nbsp%3B%20'sp-pnp-js'%40%20error%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20npm%20install%20-g%20sp-pnp-js%20--save%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20did%20not%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20npm%20install%20--save%20sp-pnp-js%20did%20work%20!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENigel%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Contributor

I have been trying to get @SPDoctor's SiteInfo web part working with SPFx framework.  One of the dependencies is sp-pnp-js.  I get failures when I try and compile the webpart with gulp serve :-

 

'typings' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.14915
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\XXXX\\YYYY\\ZZZZ\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "sp-pnp-js" "--save"
npm ERR! node v4.5.0
npm ERR! npm  v3.10.7
npm ERR! code ELIFECYCLE

npm ERR! sp-pnp-js@1.0.4 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sp-pnp-js@1.0.4 postinstall script 'typings install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sp-pnp-js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sp-pnp-js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sp-pnp-js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\XXXX\YYYY\ZZZZ\Documents\SPFx\Projects\npm-debug.log

 

Anybody Ideas ??

 

Thanks

 

Nigel

2 Replies

Hi

I finally got this to work by doing the following :-

 

npm install typings -g

 

which fixed the first problem and the I got "cannot find module  'sp-pnp-js'@ error

 

I tried npm install -g sp-pnp-js --save

 

That did not work.

 

But npm install --save sp-pnp-js did work !!

 

Regards

 

Nigel

 

Hi,

 

In the worst scenario

 

npm cache clean
npm install typings -g
npm install sp-pnp-js --save