npm install of Next.js from github fails - node.js

When trying to npm install zeit/nextjs from Github directly it fails with the following exception.
I get the same error both when running in a docker instance and directly in osx, and both on Node 5.2 and 7.2. First time I'm installing directly from GitHUB, so I don't know if I'm missing something important?
edit
npm install next
works as expected, but does not contain the latest package.json that is needed for Docker
end edit
Regards
Mattias
root#2cc7a4204924:/usr/src# npm install git+https://github.com/zeit/next.js
.
.
.
.... lots of other packages installing fine .....
.
.
.
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "git+https://github.com/zeit/next.js"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! path /usr/src/node_modules/next/dist/bin/next
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/src/node_modules/next/dist/bin/next'
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/src/node_modules/next/dist/bin/next'
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! /usr/src/npm-debug.log

Not sure why it doesn't work from github but you can do this to install the latest beta from npm:
npm i --save next#^2.0.0-beta

Installing the package by name installs it just fine but through github it throws errors. It must be a problem with the current version at Github.
npm i next // works
npm i zeit/next.js // doesn't work

Related

Trying to set up Angular application for the first time

I am having issues trying to get an angular framework setup to start a new project, and having some challenges. I installed node.js and as you can see I have v14.17.1 installed. when I try the command npm -g #angular/cli i get some errors that I don't know how to fix. Not sure what my next steps should be to help get this working. thanks.
C:\Users***\Documents\Codding\Angular>node -v v14.17.1
C:\Users*\Documents\Codding\Angular>npm -g #angular/cli npm ERR!
code ENOENT npm ERR! syscall open npm ERR! path
C:\Users*\Documents\Codding\Angular/package.json npm ERR! errno
-4058 npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users***\Documents\Codding\Angular\package.json' 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***\AppData\Local\npm-cache_logs\2021-06-23T11_15_18_924Z-debug.log
cmd promt errors
You have left out the "install" part of the npm command.
Try
npm install -g #angular/cli
Then, once that finishes, you can verify by running
ng version

"npm not being able to find a file abbrev" when installing aurelia cli

I am installing aurelia-cli in my production version. I am following instruction from 'http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli', now everytime when I am trying to run npm install aurelia-cli -g it gives me below error:
npm ERR! Linux 4.2.0-042stab113.11
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "aurelia-cli" "-g"
npm ERR! node v4.2.6
npm ERR! npm v4.0.3
npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-d3948789
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-d3948789' -> '/usr/local/lib/node_modules/aurelia-cli/node_modules/npm/node_modules/abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-d3948789' -> '/usr/local/lib/node_modules/aurelia-cli/node_modules/npm/node_modules/abbrev'
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! /etc/apt/npm-debug.log
I have no idea about that specific error, however, this often works for me, and this method of doing a fresh reinstall is often recommended on gitter by the aurelia folks:
npm uninstall -g aurelia-cli
npm clear cache
npm install -g aurelia-cli
rm -rf node_modules
npm install
npm install # on freebsd sometimes I have to run this more than once

npm run watch doesn't run: no such file or directory, open '/Users/usr/package.json'

I believe this might be happening because I used brew to install npm; I think I might have two different versions. Here is the error:
npm run watch
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.4.1_1/bin/node" "/usr/local/bin/npm" "run" "watch"
npm ERR! node v5.4.1
npm ERR! npm v3.5.3
npm ERR! path /Users/Nicolas/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/Nicolas/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/Users/Nicolas/package.json'
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! /Users/Nicolas/Code/wordpress/wp-content/themes/IMFA-theme/npm-debug.log
I have tried the following:
brew doctor (gives a lot of warnings and doesn't seem to change anything)
brew unlink and re-link (doesn't seem to do anything)
For what it's worth, I uninstalled and re-installed brew recently, and I know there are some unlinked kegs; I see this when I run brew doctor, but I don't know how to resolve it.
Other npm commands still seem to work, like npm install. However, npm run watch, in a directory where I want to compile SCSS, is giving me the error above. Any help is appreciated
I met the same problem npm err no such file or directory, open '/Users/usr/package.json' and I got the solution.
to solve the problem,you need to init your environment,like $ xxx init ,then use npm install to install the dependences.

NPM error when trying to install gulp and bower

I'm trying to install gulp and bower by running npm install --global gulp bower . Everything seems to be going fine then I get this:
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "yo" "gulp" "bower"
npm ERR! node v4.2.2
npm ERR! npm v3.5.0
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams' -> '/usr/local/lib/node_modules/gulp/node_modules/ordered-read-streams'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams' -> '/usr/local/lib/node_modules/gulp/node_modules/ordered-read-streams'
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! /Users/deang/npm-debug.log
I've also tried running the command using sudo, but to no avail. Any pointers?
Update:
This seems to be happening for everything I'm trying to install. Just tried sudo npm install --global generator-gulp-webapp and it did the same thing.
are you using npm 3.x? if so, try downgrading to npm 2.x (you can npm install npm#2.14.12).
npm 3.x has a couple of issues with yeoman

Error code -2 when installing gulp

I'm trying to install Gulp using Node.js on OSX but something goes wrong. Here's what i do.
I installed node.js
use sudo npm init to create package.json file
use sudo npm install —save-dev gulp
At this point there was the error.
npm WARN package.json dependencies#1.0.0 No description
npm WARN package.json dependencies#1.0.0 No repository field.
npm WARN package.json dependencies#1.0.0 No README data
npm ERR! addLocal Could not install /Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "—save-dev" "gulp"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! enoent ENOENT, open '/Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev'
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! /Users/dorinocanciani/Sites/prova/resources/dependencies/npm-debug.log
I searched a lot in google but with no results for this type of error.
Please can you help me to fix the error?
You missed a - in the command it should be: npm install --save-dev gulp
UPDATE: It seems like you are not using the - at all but this — that's another character and is wrong.

Resources