Closed Wintermute79 closed 3 years ago
Here is another user that obviously had encountered this behavior before: https://stackoverflow.com/a/57115209/467341
I have found the same issue and I think this might be a npm bug.
@Wintermute79 Can you try executing npm run env
?
I am running npm 7.0.14 in Windows 10 and I get a list of environment variables. However, according to npm documentation:
The env script is a special built-in command that can be used to list environment variables that will be available to the script at runtime. If an "env" command is defined in your package, it will take precedence over the built-in.
Rocket has an "env" command defined in package.json but still does not take precendence over the built in command.
If you edit package.json and change the script name from env to env-fix, for example, running npm run env-fix
works as intended and creates the missing environment file.
Thank you so much @jiniguez , that solves it.
Running npm run env
just outputs my environment variables instead of executing the script defined in package.json.
Once I rename env
(and all occurences) to env-fix
in package.json as you suggested, it works.
So the important line becomes:
"env-fix": "ngx-scripts env npm_package_version"
Then the .env.ts file in src/environments is created as intended by npm run env-fix
I am running npm 7.0.3 and node 15.0.1 on Windows 10.
I have the same issue
Thank you so much @jiniguez , that solves it.
Running
npm run env
just outputs my environment variables instead of executing the script defined in package.json.Once I rename
env
(and all occurences) toenv-fix
in package.json as you suggested, it works. So the important line becomes:"env-fix": "ngx-scripts env npm_package_version"
Then the .env.ts file in src/environments is created as intended by
npm run env-fix
I am running npm 7.0.3 and node 15.0.1 on Windows 10.
Also encountered the issue and renaming "env" script to something else worked.
I'm running in MacOS 11.1; npm 7.0.8; node v15.2.1.
Thanks for pinpointing the issue and the fix, I could never reproduce this one! Will push a fix.
:tada: This issue has been resolved in version 9.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I'm submitting a...
Current behavior
On very first
npm start
right after creating a new project, I get the following error:Expected behavior
no error message
Minimal reproduction of the problem with instructions
npm install -g generator-ngx-rocket
ngx new
npm start
Environment