Can't run tests on angular sample project - javascript

I've cloned Angular Material-Start project. As documentation says:
run npm run tests to start all your Karma unit tests.
But this conmmand gives me an error:
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\DevSoft\\NodeJs\\node.exe" "C:\\Users\\Taras\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "tests"
npm ERR! node v5.7.1
npm ERR! npm v3.8.9
npm ERR! missing script: tests
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:
What do I do wrong? How can I run the tests?

There is no tests script in the package.json file:
https://github.com/angular/material-start/blob/master/package.json
The tests have been disabled:
https://github.com/angular/material-start/commit/3a525fe89581c5b945388c1714ca3e4b64027d1e

Related

Error: Failed to find .env file at default paths

I recently switched to using dev.env & test.env for a REST API using Javascript and I'm getting the following error:
$ npm run dev
Error: Failed to find .env file at default paths: [./.env,./.env.js,./.env.json]
at getEnvFile
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! taskr#1.0.0 dev: env-cmd ./config/dev.env nodemon src/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the taskr#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Is there something I should revise in the way my .env files are stored/accessed?
try:
env-cmd -f ./config/dev.env nodemon src/index.js

How can I download and Use Angular project off of Stackblitz?

So I have a project available on stackblitz that I want to use offline for my own purposes. for reference, here is the link to what I want to use- https://stackblitz.com/edit/nvs-angular-search-dropdown-istnzp. So, I tried to download the code and planned to run it using npm install and ng serve. but I am getting lots of errors on running npm install saying like this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: angular#0.0.0
npm ERR! Found: #angular/compiler#12.0.3
npm ERR! node_modules/#angular/compiler
npm ERR! #angular/compiler#"^12.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/compiler#"7.0.4" from #angular/compiler-cli#7.0.4
npm ERR! node_modules/#angular/compiler-cli
npm ERR! dev #angular/compiler-cli#"~7.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\cnaag\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\cnaag\AppData\Local\npm-cache\_logs\2021-06-06T10_39_43_617Z-debug.log
Any help in this regard would be amazing!
Instead of NPM, install Yarn on your machine and run yarn install

I have this error message "npm ERR! Linux 5.4.72-microsoft-standard-WSL2" on my terminal when I run "npm install"

I have this error message : npm ERR! Linux 5.4.72-microsoft-standard-WSL2 on my terminal when I run npm install. I'm on a vue.js app and I have this message since I installed vuetify.
Here is the whole error message :
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "install"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function.
I also cannot install the latest version of npm I think this is related to the problem. (I have this version v3.10.10).
And when I run npm run serve I have this :
> vue-cli-service serve
sh: 1: vue-cli-service: not found
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "run" "serve"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! my-app#0.1.0 serve: vue-cli-service serve
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-app#0.1.0 serve script 'vue-cli-service serve'.
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 my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! vue-cli-service serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs my-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls my-app
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?`.
I have the Vue.JS version # vue / cli 4.5.12.
At last, I have a Window PC and I have installed linux and ubuntu.
I thank you in advance if you can help me.
Your npm version is outdated. Your version is 3.x but we're currently at 7.x
Run
npm update -g
and then try again.

Error when using npm vue-cli

Windows 10
node v8.9.2
npm 5.5.1
installed vue-cli through the use of npm but entering 'npm run dev' resulted in an error.
this is error message
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webpack-simple#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-simple#1.0.0 dev 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\hansol\AppData\Roaming\npm-cache\_logs\2017-12-08T04_14_50_859Z-debug.log
It appears as though you havent installed the node modules / dependencies.
Please try and run a
npm install
And see if that works
I used to face this problem when the port is busy.
So confirm the port you are opening for the dev server.
you can also change the port using a flag "--port 3000".

Command 'export' not recognized after 'npm run build' with webpack

We want to use webpack in our project. It has already been partly integrated as a test on a Mac and it works.
When using the same branch on my Windows machine I get following error message.
Webpack version ist 1.12.15
The part in German means that command 'export' could not be recognized or was not written correctly.
S:\project>npm run build
> project#version build S:\project
> export NODE_ENV=dev && webpack
Der Befehl "export" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\someone\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v4.4.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! project#version build: `export NODE_ENV=dev && webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project#version build script 'export NODE_ENV=dev && webpack'.
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 onedata package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! export NODE_ENV=dev && webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls project
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! S:\project\npm-debug.log
It is not possible to use the newest node.js, as some other packages are incompatible to it.

Categories