Thursday, July 20, 2017

ng new my-app

ng new my-app
Directory /home/user/my-app exists and is already an Angular CLI project.

Use the below command :

rm -rf lampp
It deletes all files and folders contained in the lampp directory.

In case user doesn't have the permission to delete the folder:

Add sudo at the beginning of the command :

sudo rm -rf folderName

ng new my-app
          cwd = process.cwd();

Error: ENOENT: no such file or directory, uv_cwd
    at Object.resolve (path.js:1163:25)
    at Function.Module._resolveLookupPaths (module.js:408:17)
    at Function.Module._resolveFilename (module.js:480:22)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object. (/usr/local/lib/node_modules/@angular/cli/bin/ng:7:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
That happened with me when I removed the directory on one terminal, but was in it on another. Just cd out of it and then back helped.
EACCES: permission denied, mkdir '/my-app'

Error: EACCES: permission denied, mkdir '/my-app'

probably combined with running npm cache clean to get any busted packages out of your cache.

npm WARN saveError EACCES: permission denied, open '/package-lock.json.577729328'
package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json

Conceptually, the "input" to npm-install is a package.json, while its "output" is a fully-formed node_modules

npm WARN saveError ENOENT: no such file or directory, open '/package.json'

sudo npm install npm@latest -g

  • Create a package.json file and store it in the folder where you will install the npm package. Keep it simple for now. This npm video helped me. Also read Using a package.json for additional information. The following example satisfies the minimum requirements:
    "name": "demo-app",
    "version": "1.0.0"

rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L | sh

No comments:

Post a Comment