Questions tagged [npm-init]

npm init is the command used to create a package.json for new modules.

Reference:

49 questions
64
votes
8 answers

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

I'm a newbie so please include links to URLs or explain terminologies so I can understand. I've managed to install 'npm' on a Mac OS (10.13.3) via the terminal, and have installed some packages like SASS using it. I'm now trying to install sass-mq…
nkhil
  • 1,452
  • 1
  • 18
  • 37
55
votes
3 answers

What is the 'npm create' command?

As the UmiJS documentation suggests, a project is created with the npm create command: npm create umi It seems to be working, but it's not documented. Why did it appear and when? Is it a full synonym for npm init? Is there a reason why npm create…
Estus Flask
  • 206,104
  • 70
  • 425
  • 565
24
votes
2 answers

How to answer the git prompt in npm init for a local repo

I already have a workspace in a local private repo of the form: ../Workspace/ComponentA/ This is already checked into git. I then go to init a new component at: ../Workspace/ComponentB so, inside ComponentB, I run npm init, and then gets to the git…
Plastikfan
  • 3,674
  • 7
  • 39
  • 54
18
votes
3 answers

NPM Init and Start

I'm using npm for a local project and I want to know if I have to use npm init every time I start a session? I think the answer is yes. If I restart my machine for example, do I have to do npm init? Do I have to do npm install and npm start each…
Al Lemieux
  • 307
  • 1
  • 3
  • 7
14
votes
6 answers

npm init not working and getting stuck on version

So I am using version 8.1.0 of Node.Js and when I call npm init to set up a project it goes to version and stays there. I have tried pressing enter or quitting with ^C but nothing happens. I have waited for over an hour and it hasn't progressed at…
Belos
  • 281
  • 1
  • 3
  • 14
11
votes
2 answers

how to un-init NPM?

So oddly I really cannot find the answer to this question and after a few posts and docs I've looked at on NPM I've decided to ask the question - which may be a very basic one but doesn't seem to be implicitly addressed... How do you uninstall npm…
Wally
  • 705
  • 1
  • 9
  • 24
7
votes
4 answers

How do I set the default test command for `npm init`?

I know I can do: npm config set init.author.email me@mycompany.com npm config set init.license UNLICENSED To set the defaults used to create a new package.json with npm init. But how can I set the default value for the test command? I've tried npm…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
6
votes
1 answer

Package Manager Console hangs on npm init

so I'm trying to run a basic npm install in NuGet and when I ran 'npm init' it hangs right after getting this far: This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible…
Brandon Miller
  • 327
  • 1
  • 4
  • 11
4
votes
2 answers

How to add Gulp to my project?

I'm using Windows 7, Visual Studio 2013. I'm trying to set up Gulp in my Client's project. I've added those Nugets to the project: Node.js version 0.12.0 Npm.js version 1.3.15.10. For some reason I don't know, when running npm init inside the nuget…
user5326354
3
votes
0 answers

Initializing ES6 module project with npm

Is there a way to have npm init directly set up an ES6 module, setting "type":"module" in package.json (or another npm command to set it)? I always just modify package.json manually and add it, but I'm wondering if there's a way to do it directly…
Jason C
  • 38,729
  • 14
  • 126
  • 182
3
votes
1 answer

What is the usage of the git repository question when running npm init?

When running npm init you are asked for the git repository (of your project I assume). I am wondering why? What is the use case to have the git repository url of the project - where the package.json is already in - also in the package.json? There…
zlZimon
  • 2,334
  • 4
  • 21
  • 51
3
votes
3 answers

npm init, 'npm ERR! name field must be a string.'

Whenever I try and run npm init, and just accept the default values, in a basic project, I get this error: npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "init" npm ERR! node v5.0.0 npm ERR! npm v3.3.6 npm ERR!…
Taylor Huston
  • 1,104
  • 3
  • 15
  • 31
2
votes
1 answer

Is there any way to include spaces in keywords while running "npm init"?

I know I can always just go back and edit the package.json later, but I can't help but be curious: Is there any way to run npm init and enter a phrase with spaces in the "keywords" part of the form? For example, entering "platform api" results in…
Eleanor Holley
  • 691
  • 1
  • 7
  • 27
2
votes
0 answers

npm init gives Error: Cannot find module 'process-nextick-args'

I've used node and npm before in one or two projects, but I'm not really proficient with it. I now want to initialize a new project on MacOS by using npm init, but I get this: $ npm init module.js:540 throw err; ^ Error: Cannot find module…
kramer65
  • 50,427
  • 120
  • 308
  • 488
2
votes
1 answer

"npm init" and using non-semver standards

When creating a new node.js project, the following is run first: npm init And there is a series of questions that will help initialize the package.json file. One of those questions is about version. The version number that is supplied as an answer…
Greeso
  • 7,544
  • 9
  • 51
  • 77
1
2 3 4