here is the error showing in my powershell
this is the error when I run this command ng serve --open
Angular CLI: 9.0.6
Node: 12.16.1
OS: win32 x64
This is my angular cli version:
I'm not sure why this error comes. I think you should try to run Angular application by : ng serve instead of ng serve --open .
I think the issue is because of an environment variable of your system path is missing . Add "C:\Windows\System32\" value to your system PATH variable.
Related
I fail to build an electron application from an angular application built in a custom path.
I know electron-packager expect that you have already run the angular build process (ng-build --prod).
That's why I'm running the following command:
ng build --prod && electron-packager . --no-prune --ignore=/node_modules --ignore=/e2e --ignore=/src --overwrite
But I would like to build angular application into a different output path like this:
ng build --prod --output-path "D:\output"
How to tell to electron-packager to use this output path?
I tried this command:
ng build --prod --output-path "D:\output" && electron-packager . --no-prune --ignore=/node_modules --ignore=/e2e --ignore=/src --overwrite
But it doesn't seem to work.
I use nodejs 14.18.1 locally and in the pipeline, a few days ago a part of the frontend started to fall off with the error "ReferenceError: Cannot access 'z' before initialization", there are no errors in the code, also the local build works, and we even uploaded it on s3 as a temporary solution, but after building via bitbucket, an error appears.
script:
- cd client
- npm install
# CI=true in default variables for Bitbucket Pipelines https://support.atlassian.com/bitbucket-cloud/docs/variables-in-pipelines/
- npm run build:br
npm run build below
"build:br": "webpack --env REACT_APP_LANGUAGE_TYPE=BRAZIL --mode production",
I've just updated the angular-cli
If I check the terminal with ng -v this is what i get:
Angular CLI: 1.6.1
Node: 8.6.0
OS: darwin x64
Angular:
...
When I try to scaffold a new angular application with the following command
ng new my-app
I get the following error message:
Error: obs.pipe is not a function
obs.pipe is not a function
I've tried to install and uninstall the cli several times but still I can't solve the issue.
I had the exact same error when using the following command
ng g module <module-name>
Turns out my problem was a mismatch between the global angular cli version and the local one. Running
npm install -save-dev #angular/cli#latest
solved it for me. (I ran it in the parent directory to the project I was using, but it should work in the same directory also).
I installed Node.js on my windows 7 local machine as this link says :
install-node-js-npm-windows
After that i installed Gulp.js by this command through command line :
npm install -g gulp
And then i add this path to environment variables area :
C:\Users\Majid\AppData\Roaming\npm\node_modules\gulp\bin
Now when i try to run gulp by this command :
gulp
I got this error :
Windows Script Host
Line: 1
Char: 1
Error: Invalid character
Code: 800A03F6
Source: Microsoft JScript compilation error
How can i solve this error & how can i make gulp.js workable on windows OS?
EDIT AFTER THE ANSWER :
Error is still there.
I went to this path :
C:\Users\User_Name\AppData\Roaming\npm\node_modules\gulp\bin
In command line and tried this command :
node gulp.js install
But it tells :
No gulpfile found
You should know gulp was installed in previous steps successfully.(With some warnings)
The structure of gulp.js is for linux based operating systems.
I am looking for a way to make this file workable on windows os.
USAGE :
I want to run this javascript based web site on my local machine...
You need to run "node node_modules\gulp\bin\gulp.js install", just add "node" command in front of it and also refer to the link below for more
Error running gulp on Windows 10
I can't comment but did you run "npm install" after forking the repository, to install package.json "dependencies, dev-dependencies"?
Gulp need to be installed Globally and also in your current working directory.
Run the code below to installed Gulp globally, and the other to install the repository dependencies.
npm install -g gulp
npm install
This answer is correct, But what was the problem in my side?
I shouldn't add this path :
C:\Users\Majid\AppData\Roaming\npm\node_modules\gulp\bin
To environment variable area.
I went to the root folder in cmd & reinstalled gulp globally and re ran npm install & finally gulp watch worked very well.
I'm trying to use karma for different watch processes.
I installed karma globally with:
npm i -g karma
Then ran karma start karma.conf.js and it worked.
Now I need to install karma locally inside the project with
npm install karma
It seems to install it fine since I have the folder karma in node_modules, however, node_modules/karma/bin/karma seems not to be the executable file to run.
How should I run karma after installing it locally?
To run locally on Windows (I'm on Windows 10), I recommend adding the following to your package.json file.
"scripts": {
"test": "cd ./node_modules/karma/bin/ && karma start"
},
Then from the command line, type npm run test
I prefer to not install a cli globally for these kinds of tools and instead run them locally from my project using a script. This way I can quickly see what version is in the dev dependencies and don't have to worry about the global version being different from the local one.
"devDependencies": {
"karma": "^1.4.0"
}
To run Karma after installing it locally:
# Run Karma:
$ ./node_modules/karma/bin/karma start
Typing ./node_modules/karma/bin/karma start sucks and so you might find it useful to install karma-cli globally. You will need to do this if you want to run Karma on Windows from the command line.
$ npm install -g karma-cli
Then, you can run Karma simply by karma from anywhere and it will always run the local version.