influxdata / docs-v2

InfluxData Documentation that covers InfluxDB Cloud, InfluxDB OSS 2.x, InfluxDB OSS 1.x, InfluxDB Enterprise, Telegraf, Chronograf, Kapacitor, and Flux.
https://docs.influxdata.com
MIT License
72 stars 267 forks source link

"npm init -y influx-node-app" Not found #5619

Closed masterj63 closed 4 days ago

masterj63 commented 1 week ago

I follow the first step of the instruction but receive error from npm:

$ npm -v
10.8.2
$ npm init -y influx-node-app
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/create-influx-node-app - Not found
npm error 404
npm error 404  'create-influx-node-app@*' is not in this registry.
Relevant URLs
jstirnaman commented 1 week ago

Thanks for pointing this out. npm init -y <new-package-name> no longer works the same way.

The command npm init -y <new-package-name> is incorrect and causes npm to search for a package named create- in the npm registry, which results in a 404 error if such a package does not exist.

Correct Usage

Creating a New Directory for the Package If you want to create a new directory for your package and initialize it there, you should first create the directory and then run npm init inside it. If you want to use package defaults, include the -y flag:

mkdir influx-node-app
cd influx-node-app
npm init -y
jstirnaman commented 1 week ago

You can also do something like the following to configure the package:

npm init -y; npm pkg set type="module"