I've had this same problem when building with [email protected] for several of our company repos. When I remove package-lock.json before running npm install it works without problems, but when I keep package-lock.json it does not always work. We also use local repositories ('file:my/module/path') and the repositories with dependencies on other local repositories are the ones that seem to not work.
Just as a thought, if there are many tools interfering with the current approach that npm is taking with the .DELETE and .STAGING folders, is there a different approach that won't have the same opportunities for tools to interfere with it?
It actually looks like the issue is occurring here:
lib/install/action/finalize.js - line 52: function moveStagingToDestination...
The moveOldDestinationAway() call is throwing the error we see, but there is an underlying error being swallowed up (empty catch) that is being thrown by the actuallyMoveStaging call.
I suspect that the staging folder is being locked up by whichever tool is being used and then the move fails. The move is failing in our case because the source file is being locked up. By the action being performed in the catch I suspect that it was originally thought that the destination was getting in the way and needed removing... this is not true in our case.
The approach could be changed to storing the staging folders in a folder that the tools won't touch.
This could be outside of the project folder (and therefore the tool's reach - I think that this could apply to the DELETE, .staging and any other temp folders), or alternatively the 'node_modules/.staging' folder could be ignored explicitly by the tools.
![File File](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/media/sdk/qs-js-node-03-npm_install.png)
Ignoring the node_modules/.staging folder may be a temporary workaround for this particular issue but I think that npm should adjust the approach to be more resilient to tools.
@zkat or @iarna (or whoever else from the team) what do you think?
Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHave 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
Comments
commented May 11, 2017â¢
![Npm speaker openal no such file or directory free Npm speaker openal no such file or directory free](http://chandanai.com/wp-content/uploads/2018/12/8-2.png)
Versions.Output from: macOS Sierra 10.12.4 Repro steps.After running |
commented May 11, 2017
to me it seems angular cli is not installed ? have you run |
commented May 11, 2017
@dave11mj's comment is on point. Check out https://github.com/angular/angular-cli#installation for install instructions. |
commented May 12, 2017
I ran that install again and I am getting a new error. Do you have any idea what could be causing this? /Users/Liz/.nvm/versions/node/v4.4.0/lib/node_modules/@angular/cli/models/config/config.js:16 SyntaxError: Unexpected token = |
commented May 12, 2017
@erbanach I haven't seen that error before .. but from what I can tell it seems you are using node |
commented May 12, 2017
I've seen in some cases NVM global installs getting completely messed up. You report Node 7, but that error log shows that stuff is running from node 4. In this case my advice is to uninstall NVM and all your node/npm versions and then reinstall them. |
commented Feb 10, 2018
(Windows machine) ERROR:
I have so many similar warning/errors in the terminal. Now doing |
commented Mar 20, 2018â¢
Since I had my ng file located at npm-global changing path did the trick. Angular CLI: 1.7.3 |
commented Apr 6, 2018
@micronyks I have same problem as you. Have you figured out a solution yet? |
commented Nov 21, 2018
alias ng='/usr/local/lib/node_modules/@angular/cli/bin/ng' |
commented Jan 2, 2019
Try this
|