Getting 404 when attempting to publish new package to NPM

前端 未结 11 1800
礼貌的吻别
礼貌的吻别 2021-01-01 08:42

I just created a new package: https://github.com/supericium/pli

I\'m now trying to publish it to NPM for the first time like this:

    ole@MKI:~/Sand         


        
11条回答
  •  情深已故
    2021-01-01 09:17

    Once you successfully publish the package you may experience when you try to npm install:

    npm ERR! code E404
    npm ERR! 404 Not Found: @xxx/yyy@latest
    

    or something similar, regardless if you npm publish was successful. In this case make sure your {main: 'file.js'} in packages.json is there.

    Ideally, you can call it index.js if you wish to leech directly from the package so you don't get things like import * from '@xxx/yyy/file'.

提交回复
热议问题