我想开始发布npm包到一个范围。我需要以该范围作为我的用户名注册用户吗?例如,如果我像这样创建一个包:
我希望开始将npm软件包发布到作用域中。我需要使用作用域作为我的用户名进行用户注册吗?例如,如果我创建了这样的软件包:
ole@MKI:~/firstpackage$ npm init
Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
name: (firstpackage) @npmtestscope/firstpackage
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /home/ole/deletethis/package.json:
{
"name": "@npmtestscope/firstpackage",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this ok? (yes)
ole@MKI:~/firstpackage$ touch README.md
ole@MKI:~/firstpackage$ npm publish
这是结果:
npm ERR! 404 Scope not found : @npmtestscope/firstpackage
那么我需要做什么才能让 npm 找到这个作用域?