Consuming node module in a tar file exposed by team city artifact - node.js

So there is currently a team city server which packages a node module for internal use and exposes it via an artifact. The artifact is a tar.gzfile which contains package.json, dist/**/*, readme.md files/folders.
In my package.json dependencies (for a dependent package) I have something like:
"some-module": "http://some-address/guestAuth/repository/download/some-project/.lastSuccessful/some-module.tar.gz"
Which resolves correctly to the tar.gz file, and I can download and open it all fine when doing it manually. However the odd thing is that when I do an npm install npm blows up with the error:
npm ERR! tar.unpack untar error C:\Users\Blah\AppData\Local\Temp\npm-10684-84325da0\some-server\guestAuth\repository\download\some-project\.lastSuccessful\some-module.tar.gz
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.3
npm ERR! path C:\Users\Blah\AppData\Local\Temp\npm-10684-84325da0\unpack-f18f9e1b
npm ERR! code EEXIST
npm ERR! errno -4075
npm ERR! syscall mkdir
npm ERR! EEXIST: file already exists, mkdir 'C:\Users\Blah\AppData\Local\Temp\npm-10684-84325da0\unpack-f18f9e1b'
npm ERR! File exists: C:\Users\Blah\AppData\Local\Temp\npm-10684-84325da0\unpack-f18f9e1b
npm ERR! Move it away, and try again.
I am super confused as I have tried doing npm cache clean and deleting my temp folder in the appdata/local nothing seems to stop this error.
I have looked over lots of related issues like:
https://github.com/npm/npm/issues/6309
https://github.com/npm/npm/issues/5133
However nothing seems to work, I am on windows 10 64-bit using npm 3.5.3 and node 4.2.6.
Has anyone else achieved the same sort of thing or is there something I am missing here as it is a blocker on a current project and none of us seem to have any idea why its blowing up.

Solved it.
So the issue was that I was not putting a containing folder in my tar file, so if you add a root folder and have your package and other files underneath that, it all works.

Related

I can't use "create-react-app" ("This is related to npm not being able to find a file.")

I tried every single thing I've found, but I just can't run create-react-app. I tried to uninstall node and install again, use yarn, clean cache, create with "npm init ..." but nothing works.
Microsoft Windows [versão 10.0.19043.1889]
(c) Microsoft Corporation. Todos os direitos reservados.
C:\Program Files (x86)\Windows Resource Kits\Tools>cd C:\Users\user\meu_app
C:\Users\user\meu_app>node -v
v16.17.0
C:\Users\user\meu_app>npm -v
8.18.0
C:\Users\user\meu_app>npx create-react-app myapp
npm ERR! code ENOENT
npm ERR! syscall spawn C:\Users\user
npm ERR! path C:\Users\user\meu_app
npm ERR! errno -4058
npm ERR! enoent spawn C:\Users\user ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2022-09-02T19_06_17_314Z-debug-0.log
I have never seen this issue before. npx is distributed with npm 5.2+, so that shouldn't be the issue. It seems your issue is similar to this one Can't install any NPM package, error 4058
Try these steps:
Delete package-lock.json and run NPM again (probably can skip this one if it does not pertain to your issue)
Ensure no other processes of node.js are running (check task manager)
If you are using visual studio code, close it and try running npm install again.
If all else fails, restart your computer.
See thread here: https://github.com/npm/npm/issues/17444
Let me know if that helps; otherwise, I will keep looking.

Can't install any packages to NPM or BOWER

I have researched this extensively and nothing. So I am hoping this generates a different solution.
I keep getting this error
npm WARN packages#1.0.0 No description
npm WARN packages#1.0.0 No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! path C:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\.staging\depd-974ec5fe
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\.staging\depd-974ec5fe' -> 'C
:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\depd'
npm ERR! at destStatted (C:\Users\Luis\AppData\Roaming\nvm\v6.9.1\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\.staging\depd-974ec5fe' -> 'C
:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\depd'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\.staging\depd-974ec5fe' ->
'C:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\depd'
npm ERR! at destStatted (C:\Users\Luis\AppData\Roaming\nvm\v6.9.1\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\.staging\depd-974ec5fe' -> 'C
:\xampp\htdocs\nodeprojects\contact-list-app\node_modules\depd'
npm ERR! at Error (native) parent: 'packages' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\nodeprojects\contact-list-app\npm-debug.log
It's not a Mac, It's a Windows machine, so nothing to do with sudo as other responses suggested here
I don't have an antivirus running so this was a no-go too
I ran npm cache clean as suggested here and other SO solutions
It was running fine, and then it started doing this when I tried to install angular-ui-bootstrap. but I was able to install other dependencies just fine.
I also did:
Restarted my machine
used CMD as administrator
Used git bash
Used npm console
Deleted the whole thing and started again in another directory ( got desperate)
uninstalled and re-installed node.js
drank a lot of coffee, and upgraded to alcohol
Please bail me out.
I am posting this answer, simply because there isn't enough documentation on this error in the web, but please if you have other ideas you'd like to add as a possible solution (other than the ones I tried in my question) please feel free. I'm sure there are a lot of other frustrated developers looking for this. Anyway, this is how I solved it.
I deleted my node_modules folder just so I can re-install the dependencies fresh. This doesn't break anything in your project because as soon as you add them back up, they will be in the exact same place they were before. So, do n't be afraid of the 404s you will get temporarily.
Then I did a fresh install by running
npm init
This get my packages.json file going
And then I tried to install my first dependency, any dependency, pick one. But the error came up and the node_modules didn't even get started. So I got it running by installing npm in itself as a dependency. Why did this work? Beats me! But the mystic powers of node know something I don't and I am ok with that.
So I did this basically
npm install npm --save
This built my node_modules folder and I was able to install everything back. I removed the npm dependency afterwards and it's like it was never there.
Again, feel free to post any other solutions. I don't think this is a definite solution so I won't mark it. It just worked for me. Thought I shared it
EDIT
DO NOT delete that npm dependency by running npm uninstall <package> as you normally would. Instead, just delete the dependency with a good 'ol delete key

Azure deployment of Swagger Node.js generated server bundle using Git failing

I'm having some difficulties deploying my project to azure. I've created a web-app and followed all the steps in deployment but it seems that some of the libraries are causing problems in that their system path is too long..
Your expert input is welcome!
Thanks so much.
Below is the log produced by Azure.
Invalid path for filesystem 'D:/home/site/repository/node_modules/swagger-tools/node_modules/swagger-converter/node_modules/lodash.clonedeep/node_modules/lodash._basecreatecallback/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._basebind/node_modules/lodash._basecreate/.gitattributes': The data area passed to a system call is too small.\r\n
UPDATE:
I removed the node_modules folder and let Azure download the libraries needed. This got further but still produced errors. Below is the past-bin with my errors.
http://pastebin.com/m3BTRYQ4
UPDATE:
I used the console to manual attempt to install the libraries. Here's the results..
D:\home\site>npm install swagger-tools -g
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\Program Files (x86)\nodejs\4.4.7\node.exe" "D:\Program Files (x86)\npm\2.15.8\node_modules\npm\bin\npm-cli.js" "install" "swagger-tools" "-g"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! path D:\local\AppData\npm\node_modules\swagger-tools\node_modules\swagger-converter\node_modules\lodash.clonedeep\node_modules\lodash._basecreatecallback\node_modules\lodash.bind\node_modules\lodash._createwrapper\node_modules\lodash._basecreatewrapper\package.json.1152100249
npm ERR! code EINVAL
npm ERR! errno -4071
npm ERR! syscall rename
npm ERR! EINVAL: invalid argument, rename 'D:\local\AppData\npm\node_modules\swagger-tools\node_modules\swagger-converter\node_modules\lodash.clonedeep\node_modules\lodash._basecreatecallback\node_modules\lodash.bind\node_modules\lodash._createwrapper\node_modules\lodash._basecreatewrapper\package.json.1152100249' -> 'D:\local\AppData\npm\node_modules\swagger-tools\node_modules\swagger-converter\node_modules\lodash.clonedeep\node_modules\lodash._basecreatecallback\node_modules\lodash.bind\node_modules\lodash._createwrapper\node_modules\lodash._basecreatewrapper\package.json'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! D:\home\site\npm-debug.log
D:\home\site>
Looks like swagger-tools tries to use a command that only works with Linux / OSX systems.
Any help is appreciated!
I try to use a higher node.js version which will include a npm with version grander than 3. And it worked successfully on my side.
Please try to specify a node.js version in your package.json file, E.G.:
"engines": {
"node": ">=5.0.0"
}
And then deploy to Azure via Git again.
Any further concern, please feel free to let me know.

Error Installing laravel-elixir on windows: npm ERR! EEXIST, open '\AppData\Roaming\npm-cache\837c67b9-adable-s tream-1-0-33-package-tgz.lock'

I have a fresh installation of laravel 5.1. I followed these steps to Set up Elixir, Bootstrap, Font-awesome etc. When I run npm install it throws an error. I also tried using npm install --no-bin-links as the laravel elixir documentation suggests.
$ npm install --no-bin-links
npm WARN optional dep failed, continuing fsevents#0.3.8
npm WARN optional dep failed, continuing fsevents#0.3.8
> node-sass#3.2.0 install c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js
Binary downloaded and installed at c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node
> node-sass#3.2.0 postinstall c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js
` c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node ` exists.
testing binary.
Binary is fine; exiting.
npm ERR! EEXIST, open 'C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock'
File exists: C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock
Move it away, and try again.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--no-bin-links"
npm ERR! cwd c:\Users\user\PhpstormProjects\my_project
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0
I searched for the file (that exists) in the npm-cache directory and found there are no such file. But, when I execute the npm command it is created along with hundreds of LOCK file. I tried to delete the file during the installation process (which is quite tricky and seems impossible, because there are a lot of files created and removed simultaneously), which didn't help much. The error is not always the same. Most of the time it says 837c67b9-adable-stream-1-0-
33-package-tgz.lock file exists, some times it's just some other LOCK file.
I also tried updating npm to the latest release: npm -g install npm#latest (sauce)
What helped me on Win 8.1:
Install newest version of Python (3.5 at the moment) and make sure it's on your path (open some command line tool like power shell and enter 'py --version').
npm cache clear
In the laravel installation folder run: npm install --no-bin-links
I was also running power shell as an administrator when issuing the commands, but I'm not sure it matters (won't hurt in this case though).
I faced the same problem and run the terminal as administrator and it solved the problem.
I am not sure about you but issue but now the gulp is working :)

Error Node downgrading

I am a beginner in development, but I want to become a leading developer of mobile applications ;)
I am on Windows 8. I want to install Cordova but I have to downgrade Node I currently 0.12.x. Version I could see that he had to make a downgrade in 0.10.x. Version
I do a downgrading but when I want to install an earlier version (0.10.32 and others)
npm unistall n
npm install n#0.10.32
I have the following errors:
C:\Users\Jeremy>npm install n#0.10.32
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "n#0.10.32"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! version not found: n#0.10.32
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jeremy\npm-debug.log
if your workflow does not involve global npm installs, etc, one approach is to simply use the node.exe executable as a stand-alone -- just grab the version you need from nodejs.org/dist and drop it into the working directory for a particular project. (Node.exe can run without actually 'installing' anything onto the system.)
then you could then specify the version of packages that you need for that version of node.exe like so: npm install foo#0.1.1.

Resources