lite-server not launching | node module permissions? - linux

When I try to start lite-server, I get this error. I'm not sure what other information is needed, but I'll be happy to provide more if necessary.
I am running this on Manjaro Linux, not sure if that has anything to do with it.
> nucampsite#1.0.0 start /home/matt/Nucamp/2-Bootstrap/NUCAMPSITE
> npm run lite
> nucampsite#1.0.0 lite /home/matt/Nucamp/2-Bootstrap/NUCAMPSITE
> lite-server
sh: line 1: /home/matt/Nucamp/2-Bootstrap/NUCAMPSITE/node_modules/.bin/lite-server: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! nucampsite#1.0.0 lite: `lite-server`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the nucampsite#1.0.0 lite script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/matt/.npm/_logs/2021-12-04T14_34_50_365Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! nucampsite#1.0.0 start: `npm run lite`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the nucampsite#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/matt/.npm/_logs/2021-12-04T14_34_50_394Z-debug.log
Here's my package.json file
{
"name": "nucampsite",
"version": "1.0.0",
"description": "This is a website for the fictional campsites review site NuCamp.",
"main": "index.html",
"scripts": {
"lite": "lite-server",
"start": "npm run lite",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.6.1"
},
"dependencies": {
"bootstrap": "^4.5.2",
"bootstrap-social": "^5.1.1",
"font-awesome": "^4.7.0",
"jquery": "^3.5.1",
"popper.js": "^1.16.1"
}

So, the problem was with the lite-server installation. I removed the node_modules folder and reinstalled. This fixed the issue.

Related

npm ERR! code ELIFECYCLE is being displayed while running "npn start" on window command line for the following package.json file

I am learning full stack web development with Angular and new to web deployment.I am unable to guess the reason behind this npm ERR! code ELIFECYCLE; displayed while running "npn start" on window command line for the following package.json file. I am stuck here and not much help available on google or I am unable to search right answer because of lack of proper keyword required to search the answer.
{
"name": "confusion",
"version": "1.0.0",
"description": "This is a website for Ristorante Con Fusion",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run watch:all",
"lite": "lite-server",
"scss": "node-sass -o css/ css/",
"watch:scss": "onchange \"css/*.scss\" -- npm run scss",
"watch:all": "parallelshell \"npm run watch:scss\" \"npm run lite\""
},
"author": "Imtiaz",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.3.0",
"node-sass": "^4.13.1",
"onchange": "^3.3.0",
"parallelshell": "^3.0.2"
},
"dependencies": {
"bootstrap": "^4.0.0",
"bootstrap-icons": "^1.0.0-alpha2",
"bootstrap-social": "^5.1.1",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"popper.js": "^1.12.9"
}
}
OutPut:
C:\Users\NEW WS-08\Bootstrap4\conFusion>npm start
> confusion#1.0.0 start C:\Users\NEW WS-08\Bootstrap4\conFusion
> npm run watch:all
> confusion#1.0.0 watch:all C:\Users\NEW WS-08\Bootstrap4\conFusion
> parallelshell "npm run watch:scss" "npm run lite"
child_process.js:422
throw new ERR_INVALID_ARG_TYPE('options.cwd', 'string', options.cwd);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "options.cwd" property must be of type str
ing. Received type function
←[90m at normalizeSpawnArguments (child_process.js:422:11)←[39m
←[90m at spawn (child_process.js:534:16)←[39m
at C:\Users\NEW WS-08\Bootstrap4\conFusion\node_modules\←[4mparallelshell←[2
4m\index.js:104:17
at Array.forEach (<anonymous>)
at Object.<anonymous> (C:\Users\NEW WS-08\Bootstrap4\conFusion\node_modules\
←[4mparallelshell←[24m\index.js:100:6)
←[90m at Module._compile (internal/modules/cjs/loader.js:955:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10
)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:811:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:723:14)←[39m
←[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)←[39
m {
code: ←[32m'ERR_INVALID_ARG_TYPE'←[39m
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! confusion#1.0.0 watch:all: `parallelshell "npm run watch:scss" "npm run
lite"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion#1.0.0 watch:all script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\NEW WS-08\AppData\Roaming\npm-cache\_logs\2020-03-26T08_26
_18_785Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! confusion#1.0.0 start: `npm run watch:all`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\NEW WS-08\AppData\Roaming\npm-cache\_logs\2020-03-26T08_26
_18_841Z-debug.log
This is a common issue can not be fixed using npm audit fix. All you can do is to copy the actual index.js file of parallelshell into your node_modules directory.
So to do it below are the instructions:
1. Go to https://raw.githubusercontent.com/darkguy2008/parallelshell/master/index.js
2. Copy the content here.
3. Now go to the directory of your project, it may be something like /project/node_modules/parallelshell/index.js
4. Inside the index.js replace the contents with the one you copied from the link in Step 1.
5. Save the file and exit.
Hope this fix will work for you.

Using NPM for SCSS but the script will not watch for changes. It gives me a error

I have installed Node v12.10.0, NPM v6.10.3. I have also tried to install the node LTS version as well.
I built my project directory and inside the directory I ran "npm init" and after I ran "npm install --save-dev node-sass". Everything seems good up to this point.
my package.json file looks like this
{
"name": "dashboard",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"scss": "node-sass --watch scss -o css"
},
"author": "",
"license": "ISC",
"devDependencies": {
"node-sass": "^4.12.0"
}
}
After I go to run " npm run scss" then I receive this.
> dashboard#1.0.0 scss /Users/adakaitalker/Documents/school/dev/learning/2-september/4-week/9:13:19/dashboard
> node-sass --watch scss -o css
sh: node-sass: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! dashboard#1.0.0 scss: `node-sass --watch scss -o css`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the dashboard#1.0.0 scss script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adakaitalker/.npm/_logs/2019-09-13T22_43_56_711Z-debug.log
figured it out. I installed homebrew and linked it to node then I used homebrew to uninstall it and reinstall it and it works now.

'.' is not recognized as an internal or external command (when running npm install for firebaseUI)

I cannot install npm packages on my firebaseUI demo application.
I cloned the master branch on github and am simply trying to run "npm install" but I am getting an error I have never come across with node package manager. I get
'.' is not recognized as an internal or external command
I also tried this will cygwin64 and had the exact same result. below is the error, and below that is my package.json
firebaseui#3.3.0 generate-test-files C:\repos\Firebase Demos\firebaseui-web
> ./buildtools/generate_test_files.sh
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! firebaseui#3.3.0 generate-test-files: `./buildtools/generate_test_files.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the firebaseui#3.3.0 generate-test-files script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\adam\AppData\Roaming\npm-cache\_logs\2018-08-18T01_43_27_526Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! firebaseui#3.3.0 test: `npm run build && npm run generate-test-files && ./buildtools/run_tests.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the firebaseui#3.3.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\adam\AppData\Roaming\npm-cache\_logs\2018-08-18T01_43_27_547Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! firebaseui#3.3.0 prepublish: `npm run test && cp -r dist demo/public`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the firebaseui#3.3.0 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\adam\AppData\Roaming\npm-cache\_logs\2018-08-18T01_43_27_577Z-debug.log
package.json
{
"name": "firebaseui",
"version": "3.3.0",
"description": "Javascript library for customizable UI on top of Firebase SDK",
"files": [
"dist/firebaseui.js",
"dist/firebaseui.css",
"dist/npm.js",
"dist/index.d.ts",
"dist/externs",
"LICENSE",
"README.md",
"package.json"
],
"main": "./dist/npm.js",
"types": "./dist/index.d.ts",
"style": "dist/firebaseui.css",
"scripts": {
"build": "gulp",
"build-all": "gulp build-all",
"build-soy": "gulp build-soy",
"demo": "npm run build && ./buildtools/run_demo.sh",
"test": "npm run build && npm run generate-test-files && ./buildtools/run_tests.sh",
"serve": "npm run build && npm run generate-test-files && gulp serve",
"generate-test-files": "./buildtools/generate_test_files.sh",
"prepublish": "npm run test && cp -r dist demo/public"
},
"test": "npm run test",
"author": "Google",
"repository": {
"type": "git",
"url": "https://github.com/firebase/firebaseui-web.git"
},
"license": "Apache-2.0",
"devDependencies": {
"closure-builder": "^2.2.34",
"firebase": "^5.0.0",
"firebase-tools": "^4.0.1",
"fs-extra": "^3.0.1",
"google-closure-compiler": "^20171112.0.0",
"google-closure-library": "^20171112.0.0",
"google-closure-templates": "^20150410.0.0",
"gulp": "^4.0.0",
"gulp-clean-css": "^2.0.12",
"gulp-closure-compiler": "^0.4.0",
"gulp-concat-css": "^3.1.0",
"gulp-connect": "^5.5.0",
"gulp-css-flip": "^0.4.0",
"gulp-css-inline-images": "^0.1.1",
"gulp-sass": "^2.3.2",
"gulp-util": "^3.0.7",
"material-design-lite": "^1.2.0",
"protractor": "^5.3.2",
"streamqueue": "^1.1.1"
},
"dependencies": {
"dialog-polyfill": "^0.4.7"
},
"peerDependencies": {
"firebase": ">=5.0.0"
}
}
Although this question is old I ran into the same problem when I was collaborating with another developer using another OS (Linux x Windows).
At the beginning of the project a script .sh was failing depending on the OS. We had to constantly modify the json file after merging some branch.
The solution we came up with was to append the shell being used to call the script, e.g. we changed the initialization script to
...
{
start: bash ./myscript && npm run start
}
...
It works fine on Linux and on Gitbash on Windows.
> ./buildtools/generate_test_files.sh
here just leave out dot-slash(./)
Though, if you wanted to, you could use .\\ (since single '\' would skip the next character) and it would work.

Use dependencies from a private GitLab with NPM

I'm trying to install NPM dependencies from a private GitLab instence.
So, I have my repo with basic files
And I added this dependencie in the package.json on my project
"node-demo-package": "https://oauth2:<ACCESS TOKEN>#gitlab.fullurl.git"
But, when I run npm install, I receive this error message:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: node-demo-package#https://oauth2:<ACCESS TOKEN>#gitlab.fullurl.git.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/arnaud.delante/.npm/_logs/2018-01-24T15_05_49_456Z-debug.log
Which I don't understand as there is a package.json as showed in the screenshot.
Here it is
{
"name": "demo-package",
"version": "1.0.0",
"description": "Test pasckage",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git#gitlab.fullurl.git"
},
"author": "Arnaud Delante",
"license": "MIT"
}
I already tried switching https by git+https but I get another error
npm ERR! Error while executing:
npm ERR! /usr/local/bin/git ls-remote -h -t https://oauth2:<ACCES TOKEN>#gitlab.fullrul.git
npm ERR!
npm ERR! remote: You are not allowed to download code from this project.
npm ERR! fatal: unable to access 'https://oauth2:<ACCES TOKEN>#gitlab.fullrul.git': The requested URL returned error: 403
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/arnaud.delante/.npm/_logs/2018-01-24T17_19_16_677Z-debug.log
Which is weird because the token is correct.
Would you have any idea?
In package.json try to replace https:// by git+https://
doc : https://docs.npmjs.com/files/package.json#git-urls-as-dependencies

node.js version issue or something else

I have
"node":"0.10.12",
"npm":"1.2.30"
in my package and i have installed
node 0.10.26
and
npm 1.4.7
and having an
error Failed at the Kiwi-Move-API#0.0.1 start script.
npm ERR! This is most likely a problem with the Kiwi-Move-API package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls Kiwi-Move-API
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.0-35-generic
npm ERR! command "node" "/usr/local/bin/npm" "start"
npm ERR! cwd /home/asnadatta/work/kiwi/kiwi-devkit
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.7
npm ERR! code ELIFECYCLE
this is my complete package
{
"name": "Kiwi-Move-API",
"version": "0.0.1",
"description": "Kiwi Move Webservices API",
"main": "server.js",
"engines": {
"node":"0.10.12",
"npm":"1.2.30"
},
"dependencies": {
"express": "~3.3.4",
"mongoose": "~3.6.14",
"mongo": "~0.1.0",
"redis": "~0.8.4",
"ws": "~0.4.27",
"mocha": "~1.12.0",
"bcrypt": "0.7.6",
"node-oauth2-server":"1.5.0",
"underscore":"1.5.1",
"nodemailer":"0.5.2",
"should":"1.2.2",
"request":"2.25.0",
"nano": "~4.1.4"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [
"Kiwi",
"Move",
"Kiwi",
"Wearable",
"Tech"
],
"author": "Mike Holmes",
"license": "BSD"
}
Is this versions issue or some thing else

Resources