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

NPM issue installing @microsoft/generator-sharepoint #992

Closed
sanjayMT opened this issue Oct 26, 2017 · 16 comments
Closed

NPM issue installing @microsoft/generator-sharepoint #992

sanjayMT opened this issue Oct 26, 2017 · 16 comments

Comments

@sanjayMT
Copy link

Hi,

While installing @microsoft/generator-sharepoint using npm I'm getting following error:

C:\>Npm install -g @microsoft/generator-sharepoint

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: connect 2.x series is deprecated
npm WARN deprecated [email protected]: not actively maintained anymore
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm ERR! tar.unpack untar error C:\Users\useraccount\AppData\Roaming\npm-cache\node-forge\0.7.1\package.tgz
C:\Users\useraccount\AppData\Roaming\npm
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules@microsoft\generator-sharepoint\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of ajv@>=5.0.0 but none was installed.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\useraccount\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "@microsoft/generator-sharepoint"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10
npm ERR! path C:\Users\useraccount\AppData\Roaming\npm\node_modules.staging\node-forge-29ac5de4\flash\swf\SocketPool.swf
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall lstat

npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\useraccount\AppData\Roaming\npm\node_modules.staging\node-forge-29ac5de4\flash\swf\SocketPool.swf'
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\useraccount\AppData\Roaming\npm\node_modules.staging\node-forge-29ac5de4\flash\swf\SocketPool.swf'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! C:\npm-debug.log
npm ERR! code 1

Here are my node & NPM version details

C:\>node -v
v6.11.5
C:\>npm -v
3.10.10

Please let me know what could be the issue here

Thanks,
Sanju

@waldekmastykarz
Copy link
Collaborator

Have you tried installing the generator again to verify this wasn't a one-time issue?

@sanjayMT
Copy link
Author

sanjayMT commented Nov 7, 2017

Hi Waldek,

I have tried installing @microsoft/generator-sharepoint multiple times on my system but I got the same error.

So I took "node_modules" including @microsoft folder from my colleague's system and copied the same to my project "HelloWorld" local folder and it started working.

@sanjayMT sanjayMT closed this as completed Nov 7, 2017
@sanjayMT sanjayMT reopened this Nov 7, 2017
@sanjayMT
Copy link
Author

sanjayMT commented Nov 7, 2017

I have reopened this ticket, as above solution is just a work-around. I need to know why @microsoft/generator-sharepoint module is not getting installed on my system and how do I check the same?

@waldekmastykarz
Copy link
Collaborator

Have you tried running the command prompt as admin?

@sanjayMT
Copy link
Author

sanjayMT commented Nov 7, 2017

Yes ..I'm running the command prompt as admin.

Another observation, after copying node_module to local folder of my sharepoint web part project. I'm able to do "gulp serve" and it opens the SharePoint workbench.

But if I move the same node module contents to "C:\Users\user-name\AppData\Roaming\npm" then runs gulp server, it says
Local gulp not found in [current_folder_path]
Try running: npm install gulp

Why its looking for local gulp when its there in global path?

@waldekmastykarz
Copy link
Collaborator

waldekmastykarz commented Nov 7, 2017

That's specific to gulp and how it works: it always requires to be installed both globally and locally.

@waldekmastykarz
Copy link
Collaborator

On another note: you should not move your local node_modules folder to the location where globally installed packages are. The only package you have to have installed globally is (at)microsoft/generator-sharepoint. In your project however, you have installed all dependencies required for your project to run.

@sanjayMT
Copy link
Author

sanjayMT commented Nov 7, 2017

  1. Now I installed gulp locally, npm install gulp. It successfully got installed
  2. if I run gulp serve, it throws error "Error: Cannot find module '@microsoft/sp-build-web'

But @microsoft/sp-build-web is already there in global folder. This means, for some reason it always looking for all the modules in local folder only. What could be the issue?

@waldekmastykarz
Copy link
Collaborator

waldekmastykarz commented Nov 7, 2017

are you still having the node_modules folder from your project in C:\Users\user-name\AppData\Roaming\npm?

@arjunumenon
Copy link
Contributor

arjunumenon commented Dec 7, 2017

Hey Waldek,

Just stumbled upon this post. Apparently I am also facing the same issue. There is a small difference, I am getting this when I create SPFx project (yo @ microsoft/sharepoint). The strange thing is, out of 10 attempts, it works at times.
Had tried all the combinations.

  • Trying npm cache clear (Running as an admin).

These did not help either. Any idea what might be stopping this from creating the project.

Help is appreciated

@waldekmastykarz
Copy link
Collaborator

@arjunumenon what error are you getting exactly?

@arjunumenon
Copy link
Contributor

Hey @waldekmastykarz ,
During the execution, the first error which I am getting is,
npm ERR! tar.unpack untar error C:\Users\username\AppData\Roaming\npm-cache\node-forge\0.7.1\package.tgz

And towards the end of execution, following are the errors which are there at the bottom.

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\username\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--cache-min" "86400"
npm ERR! node v6.12.0
npm ERR! npm v3.10.10
npm ERR! path D:\blah\blah\SampleWP\RnD\node_modules.staging\node-forge-dc10c1f7\flash\swf\SocketPool.swf
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall lstat

npm ERR! enoent ENOENT: no such file or directory, lstat 'D:\blah\SpFx\SampleWP\RnD\node_modules.staging\node-forge-dc10c1f7\flash\swf\SocketPool.swf'
npm ERR! enoent ENOENT: no such file or directory, lstat 'D:\blah\SpFx\SampleWP\RnD\node_modules.staging\node-forge-dc10c1f7\flash\swf\SocketPool.swf'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.

Let me know if you need any more information on the same please.

@arjunumenon
Copy link
Contributor

#1115 I Have created another issue in Git. We can converse in that if you are fine with that.

@nickpape
Copy link

Hi all,

Normally this issue is some sort of permissions error with NPM, you can find a number of similar issue on GitHub:

npm/npm#5133
npm/npm#10455
https://stackoverflow.com/questions/29380851/npm-install-causes-errors-like-npm-err-tar-unpack-untar-error-on-debian

Alternately, we have experienced a similar issue internally as well (as well as other NPM users). Specifically, this is a race condition in the request library that occurs:

  • If the tarball is bigger than ~50KB (node-forge is 420KB)
  • The download involves redirects (which could occur if you are using a proxy such as VSTS)

We have opened an issue with the project maintainer, but there has been very little activity on that project (they have not merged our PR with a workaround). Unfortunately the only workaround is... not using NPM, but instead using a different package manager. We have been working on migrating to PNPM (a far, far superior package manager) internally, but have not completed this migration. The owner of that project has already mitigated this issue.

We are hoping to advise our customers to use pnpm in the future, but right now some of our libraries don't fully support it.

@nickpape
Copy link

Closing this issue as #1115 was fixed.

@msft-github-bot
Copy link
Collaborator

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

@SharePoint SharePoint locked as resolved and limited conversation to collaborators Jan 28, 2020
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

5 participants