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

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.

Related

lite-server not launching | node module permissions?

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.

Google Cloud: Create A Simple Application With the API samples npm install failed

Following the instruction from here, https://cloud.google.com/bigquery/create-simple-app-api
cd to the samples folder
https://github.com/googleapis/nodejs-bigquery/tree/master/samples
The package.json is
https://github.com/googleapis/nodejs-bigquery/blob/master/samples/package.json
{
"name": "nodejs-docs-samples-bigquery",
"version": "0.0.1",
"private": true,
"license": "Apache-2.0",
"author": "Google LLC",
"repository": "googleapis/nodejs-bigquery",
"engines": {
"node": ">=4"
},
"scripts": {
"test": "repo-tools test run --cmd npm -- run cover",
"ava": "ava -T 3m --verbose test/*.test.js system-test/*.test.js",
"cover": "nyc --reporter=lcov --cache ava -T 3m --verbose test/*.test.js system-test/*.test.js && nyc report"
},
"dependencies": {
"#google-cloud/bigquery": "1.2.0",
"#google-cloud/storage": "1.5.1",
"yargs": "10.0.3"
},
"devDependencies": {
"#google-cloud/nodejs-repo-tools": "2.1.3",
"ava": "0.24.0",
"nyc": "11.3.0",
"proxyquire": "1.8.0",
"sinon": "4.1.3",
"uuid": "3.1.0"
}
}
I run
npm install
I get errors
Home-iMac:samples user1$ npm install
npm WARN #google-cloud/bigquery#1.2.0 had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.
npm ERR! path /Users/user1/project1/gcp/nodejs/bigquery_api/nodejs-bigquery-test/samples/node_modules/.staging/#google-cloud/bigquery-78ee5bef/node_modules/#sindresorhus/is
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/user1/project1/gcp/nodejs/bigquery_api/nodejs-bigquery-test/samples/node_modules/.staging/#google-cloud/bigquery-78ee5bef/node_modules/#sindresorhus/is' -> '/Users/user1/project1/gcp/nodejs/bigquery_api/nodejs-bigquery-test/samples/node_modules/.staging/#sindresorhus/is-79439449'
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! /Users/user1/.npm/_logs/2018-04-27T19_38_14_391Z-debug.log
To fix the error, a hack solution is instead of using the package.json to install, I have to run this manually first
npm install --save #google-cloud/bigquery
Then I can run
npm install
again. This time, it will finish without problem.
But I would like to be able to just simply using package.json, using npm install only to install the packages.
I changed the package.json
From
"#google-cloud/bigquery": "1.2.0",
to
"#google-cloud/bigquery": "^1.2.0",
It still does not work.
Thanks!
#Tim - Thanks for the request to update, #google/bigquery 1.3.0 is being used for the example. The download link to the GitHub site was updated, but the sample code on the page itself is not updated.

react-scripts: not found on create-react-app project on ubuntu?

I am working on reactjs using this one
https://github.com/facebookincubator/create-react-app
But when i deploy it to digitalocean on top of ubuntu 16
I can not run npm run build and got this as an error.
deploy#xxxx:/www/tmdb_admin$ sudo npm run build
[sudo] password for deploy:
> tmdb_admin#0.1.0 build /www/tmdb_admin
> react-scripts build
sh: 1: react-scripts: not found
npm ERR! Linux 4.4.0-57-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v7.3.0
npm ERR! npm v4.0.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! tmdb_admin#0.1.0 build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the tmdb_admin#0.1.0 build script 'react-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the tmdb_admin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs tmdb_admin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls tmdb_admin
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /www/tmdb_admin/npm-debug.log
So this is my package.json file.
{
"name": "tmdb_admin",
"version": "0.1.0",
"private": true,
"devDependencies": {
"autoprefixer-stylus": "0.10.0",
"concurrently": "3.0.0",
"react-scripts": "0.6.1",
"stylus": "0.54.5"
},
"dependencies": {
"bulma": "^0.2.3",
"case-sensitive-paths-webpack-plugin": "^1.1.4",
"es6-promise": "^4.0.5",
"font-awesome": "^4.7.0",
"isomorphic-fetch": "^2.2.1",
"jwt-simple": "^0.5.0",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-pagify": "^2.1.1",
"react-redux": "^4.4.5",
"react-router": "^2.4.0",
"react-router-redux": "^4.0.4",
"react-slick": "^0.14.5",
"redux": "^3.5.2",
"redux-thunk": "^2.1.0",
"segmentize": "^0.4.1",
"slick-carousel": "^1.6.0"
},
"scripts": {
"start": "react-scripts start",
"watch": "concurrently --names 'webpack, stylus' --prefix name 'npm run start' 'npm run styles:watch'",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"styles": "stylus -u autoprefixer-stylus ./src/css/style.styl -o ./src/css/style.css",
"styles:watch": "stylus -u autoprefixer-stylus -w ./src/css/style.styl -o ./src/css/style.css"
}
}
And this is my node and npm version.
deploy#xxxx:~$ node -v
v7.3.0
deploy#xxxx:~$ npm -v
4.0.5
How can i fix this and make npm run build works?
Thanks!
I had the same problem today and I fixed it running install again.
All that you need to do is rum again the command npm install into your project so you'll be able to run npm start comand again!
Works for me!
I hope I've Helped!
When you copy a generated create-react-app project to another directory (i.e. when it was deployed to the server), it failed because symlinks were not preserved. See https://github.com/facebookincubator/create-react-app/issues/200. The file react-scripts in ./node_modules/.bin/ needs to be symlinked to ./node_modules/react-scripts/bin/react-scripts.js. Using diff will not show the differences since the symlinks will be resolved.
Easiest solution is to create a temporary react project on the server (i.e. on the Digitalocean) and then copy the content of the ./node_modules/.bin using copy -a (and not copy -r, in order to preserve symlinks).
$ create-react-app tempReact
$ cp -a tempReact/node_modules/.bin/* myActualReactApp/node_modules/.bin
Another solution is to manually re-create the symlinks.
$ ln -s myActualreactApp/node_modules/react-scripts/bin/react-scripts.js myActualReactApp/node_modules/.bin/react-scripts
Run:
sudo chown -R $USER:$USER '/home/ubuntu/.npm/'
On Linux OS NPM and NodeJS are installed globally with sudo and the owner of that files is the root and usually a user can only read/execute that packages. When NPM is stalled a ~/.npm/ folder is created by the root. By running create-react-app you are executing the command as user and create-react-app is trying to modify something in the ~/.npm/ directory which is owned by the root and not to current user. You need to change the owner of that directory to you, so you can modify it without sudo privileges.
Often similar thing happens when you install NPM package with sudo e.g. sudo npm install --save. Again the newly installed package in owned by the root and for example when you try to update/modufy/delete your project without sudo infrnt of NPM you will have similar permission error. In these cases navigate to your project directory and change its owner by running:
sudo chown -R $USER:$USER
Source: create-react-app fails with permission denied

Npm start doesn't work in an Angular 2 and Laravel 5 project

I am working on a Laravel 5.2 and Angular 2 project and I've just finished setting up angular but when running npm start, I get the following error :
npm ERR! Windows_NT 6.1.7601
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.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! # postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # postinstall script 'typings install'.
npm ERR! This is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
Can you guys help me ?
This is the content of my package.json :
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch",
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^5.0.0",
"bootstrap-sass": "^3.0.0",
"concurrently": "^1.0.0",
"del": "^2.2.0"
},
"dependencies": {
"angular2": "2.0.0-beta.0",
"bootstrap-sass": "^3.0.0",
"elixir-typescript": "^1.1.2",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"laravel-elixir": "^4.0.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"systemjs": "0.19.6",
"zone.js": "0.5.10"
}
}
Your script is failing while trying to run 'typings install'.
1. Include typings in devDependencies
{
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^1.0.4"
}
}
Run npm install
Create typings.json as below
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160602141332",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160807145350"
}
}
npm start
if you still having issue install typings globally
npm install typings --global
I too face this problem i do the following steps
1. i uninstall nodejs and install the latest version.
2. close the command promt and open.
3. execute npm install
4. execute npm build(not nesessery)
5. execute npm start
This works for me.

npm install showing some error EACCESS

i recently reinstalled ubuntu os and installed npm and nodejs, but when i run npm install i am issues with EACCESS which i am unable to understand, anyhelp ?
i was googling it about this issue but still could not fix it from hours, even i was going through many posts in stackoverflow but none solved my issue, can anyone please let me y is it happening ?
npm install
> angular-seed#0.0.0 postinstall /home/sri/oxkey
> bower install
/home/sri/oxkey/node_modules/bower/node_modules/configstore/index.js:56
throw err;
^
Error: EACCES: permission denied, open '/home/sri/.config/configstore/bower-github.yml'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (evalmachine.<anonymous>:549:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:397:15)
at Object.create.all.get (/home/sri/oxkey/node_modules/bower/node_modules/configstore/index.js:34:29)
at Object.Configstore (/home/sri/oxkey/node_modules/bower/node_modules/configstore/index.js:27:44)
at readCachedConfig (/home/sri/oxkey/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/home/sri/oxkey/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/home/sri/oxkey/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
npm ERR! Linux 4.2.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.4
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! angular-seed#0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-seed#0.0.0 postinstall script 'bower install'.
npm ERR! This is most likely a problem with the angular-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-seed
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/sri/oxkey/npm-debug.log
heres my package.json file
may be there might be some silly mistakes, but really i am not able to get out of this.may i know why we will be getting this kind of errors actually ? Any help would be appreciated
{
"name": "angular-seed",
"private": true,
"version": "0.0.0",
"description": "A starter project for AngularJS",
"repository": "https://github.com/angular/angular-seed",
"license": "MIT",
"devDependencies": {
"bower": "^1.3.1",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-watch": "^0.6.1",
"http-server": "^0.6.1",
"jasmine-core": "^2.3.4",
"karma": "~0.12",
"karma-chrome-launcher": "^0.1.12",
"karma-firefox-launcher": "^0.1.6",
"karma-jasmine": "^0.3.5",
"karma-junit-reporter": "^0.2.2",
"protractor": "^2.1.0",
"shelljs": "^0.2.6"
},
"scripts": {
"postinstall": "bower install",
"prestart": "npm install",
"start": "lr-http-server",
"pretest": "npm install",
"test": "karma start karma.conf.js",
"test-single-run": "karma start karma.conf.js --single-run",
"preupdate-webdriver": "npm install",
"update-webdriver": "webdriver-manager update",
"preprotractor": "npm run update-webdriver",
"protractor": "protractor e2e-tests/protractor.conf.js",
"update-index-async": "node -e \"require('shelljs/global'); sed('-i', /\\/\\/##NG_LOADER_START##[\\s\\S]*\\/\\/##NG_LOADER_END##/, '//##NG_LOADER_START##\\n' + sed(/sourceMappingURL=angular-loader.min.js.map/,'sourceMappingURL=bower_components/angular-loader/angular-loader.min.js.map','app/bower_components/angular-loader/angular-loader.min.js') + '\\n//##NG_LOADER_END##', 'app/index-async.html');\""
}
}
Clean your npm cache:
npm cache clean
and run following command to grant access to specified directory
sudo chown -R $(whoami) ~/.config
After that you need to install it again from scratch and everything will work.
If just sudo-ing still fails with EACCESS, try:
sudo npm c get user
By doing this, I found out that when sudo-ed, the npm was using my orignal user ID (!) Using temporary configuration override user = 0 might be the easiest fix in this case. Beware not to use it for local installations, though!
This behavior of npm occurred to me after some system update (using Mac OS 10.13.6), but I'm unable to figure out, when exactly it happened.
You have to be root. Try:
sudo npm install
and then type your root password

Resources