# (Solved) Error installing my new (& first) cli-generated plugin

**URL:** <https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604>\
**Category:** Help Requests\
**Created:** [June 1, 2019, 1:18pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604 "2019-06-01T13:18:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [June 1, 2019, 1:18pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/1 "2019-06-01T13:18:31Z")

</div>

Hello All,

I am using the new plugin support from the CLI for my 1st attempt to introduce plugin’s into my workflow

It started out great! Once I had the elements stabilized I just copied the files over from my project into the plugin skeleton and bang! they just worked.

I then published the plugin repo to our in-house gitLab (community edition) repo server

And now I’m back to the main project and trying to consume this plugin by installing it with npm and it’s complaining at me that there is no package.json file

I can’t even get to the point of calling it out in my code - I don’t know what I’ve done wrong.

(To get npm to stop complaining about certificate chains I had to turn off npm’s requirement for good certificates with this: npm set strict-ssl false)

I do not understand how it could complain that I do not have a package.json in my current directory – there is one here and also one in the plugin repo – in no way are they .gitignore’d

What am I doing wrong?

```
--- from the plugin project ---

$ ls -l
total 720
-rw-r--r-- 1 ajoslin staff 6835 Oct 26 1985 README.md
lrwxr-xr-x 1 ajoslin admin 13 Jun 1 07:27 SAEImages -> ../SAEImages/
lrwxr-xr-x 1 ajoslin admin 15 Jun 1 07:27 SAEShoppers -> ../SAEShoppers/
drwxr-xr-x 6 ajoslin admin 192 May 31 20:04 aurelia_project
drwxr-xr-x 6 ajoslin admin 192 May 31 21:00 dev-app
drwxr-xr-x 4 ajoslin admin 128 Jun 1 08:23 dist
-rw-r--r-- 1 ajoslin staff 15086 Oct 26 1985 favicon.ico
-rw-r--r-- 1 ajoslin staff 302 Oct 26 1985 index.html
-rw-r--r-- 1 ajoslin staff 158 Oct 26 1985 jsconfig.json
drwxr-xr-x 658 ajoslin admin 21056 May 31 20:13 node_modules
-rw-r--r-- 1 ajoslin admin 330539 May 31 20:13 package-lock.json
-rw-r--r-- 1 ajoslin staff 1509 May 31 23:23 package.json
drwxr-xr-x 6 ajoslin admin 192 May 31 20:13 scripts
drwxr-xr-x 8 ajoslin admin 256 May 31 21:07 src

$ cat .gitignore
.DS_STORE
Thumbs.db
.idea
.vscode/*
!.vscode/launch.json
node_modules
scripts
src/environment.js
gitVersion
test/coverage*
.chrome
*.zip
SAEImages
SAEShoppers

--- from the consuming project ---

$ ls -l
total 840
-rw-r--r-- 1 ajoslin admin 744 May 28 09:07 README.md
drwxr-xr-x 6 ajoslin admin 192 May 2 11:26 aurelia_project
drwxr-xr-x 26 ajoslin admin 832 Jun 1 07:29 dist
-rw-r--r-- 1 ajoslin admin 15086 Oct 26 1985 favicon.ico
-rw-r--r--@ 1 ajoslin admin 390 Oct 26 1985 index.ejs
-rw-r--r-- 1 ajoslin admin 188 Oct 26 1985 jsconfig.json
drwxr-xr-x 775 ajoslin admin 24800 May 31 19:04 node_modules
-rw-r--r-- 1 ajoslin admin 382971 May 31 19:04 package-lock.json
-rw-r--r-- 1 ajoslin admin 1776 May 31 19:04 package.json
drwxr-xr-x 10 ajoslin admin 320 May 24 13:47 src
drwxr-xr-x 4 ajoslin admin 128 May 17 14:13 static
-rw-r--r--@ 1 ajoslin admin 8633 May 31 17:44 webpack.config.js

$ cat .gitignore
.DS_STORE
Thumbs.db
.idea
.vscode/*
!.vscode/launch.json
node_modules
dist
src/environment.js
gitVersion
test/coverage*
.chrome
*.zip

--- attempted consumption ---

$ npm i --save https://git.<ourdomain>.com/ajoslin/my-plugin.git
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: https://git.<ourdomain>.com/ajoslin/my-plugin.git.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ajoslin/.npm/_logs/2019-06-01T13_13_48_175Z-debug.log
$ caat /Users/ajoslin/.npm/_logs/2019-06-01T13_13_48_175Z-debug.log

$ cat /Users/ajoslin/.npm/_logs/2019-06-01T13_13_48_175Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/Users/ajoslin/.nvm/versions/node/v10.14.0/bin/node',
1 verbose cli '/Users/ajoslin/.nvm/versions/node/v10.14.0/bin/npm',
1 verbose cli 'i',
1 verbose cli '--save',
1 verbose cli 'https://git.<ourdomain>.com/ajoslin/my-plugin.git' ]
2 info using npm@6.7.0
3 info using node@v10.14.0
4 verbose npm-session f168af1f3cf770be
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://git.<ourdomain>.com/ajoslin/my-plugin 1205ms
8 silly fetchPackageMetaData error for https://git.<ourdomain>.com/ajoslin/my-plugin.git Non-registry package missing package.json: https://git.<ourdomain>.com/ajoslin/my-plugin.git.
9 timing stage:rollbackFailedOptional Completed in 0ms
10 timing stage:runTopLevelLifecycles Completed in 2481ms
11 verbose stack Error: Non-registry package missing package.json: https://git.<ourdomain>.com/ajoslin/my-plugin.git.
11 verbose stack at BB.join (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/pacote/lib/finalize-manifest.js:163:23)
11 verbose stack at tryCatcher (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
11 verbose stack at Holder$5._callFunction (eval at generateHolderClass (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:14:44)
11 verbose stack at Holder$5.checkFulfillment (eval at generateHolderClass (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:29:30)
11 verbose stack at Promise.eval (eval at thenCallback (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:14:16), <anonymous>:6:20)
11 verbose stack at Promise._settlePromise (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
11 verbose stack at Promise._settlePromise0 (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
11 verbose stack at Promise._settlePromises (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:694:18)
11 verbose stack at _drainQueueStep (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
11 verbose stack at _drainQueue (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
11 verbose stack at Async._drainQueues (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
11 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (/Users/ajoslin/.nvm/versions/node/v10.14.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
11 verbose stack at runCallback (timers.js:705:18)
11 verbose stack at tryOnImmediate (timers.js:676:5)
11 verbose stack at processImmediate (timers.js:658:5)
12 verbose cwd /Users/ajoslin/Documents/Als/Development/EPC/Development/shop-and-earn/shop-and-earn-site
13 verbose Darwin 18.5.0
14 verbose argv "/Users/ajoslin/.nvm/versions/node/v10.14.0/bin/node" "/Users/ajoslin/.nvm/versions/node/v10.14.0/bin/npm" "i" "--save" "https://git.<ourdomain>.com/ajoslin/my-plugin.git"
15 verbose node v10.14.0
16 verbose npm v6.7.0
17 error code ENOPACKAGEJSON
18 error package.json Non-registry package missing package.json: https://git.<ourdomain>.com/ajoslin/my-plugin.git.
19 error package.json npm can't find a package.json file in your current directory.
20 verbose exit [1, true]
```

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [June 1, 2019, 10:44pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/2 "2019-06-01T22:44:30Z")

</div>

Have you found anything about missing package.json when publishing to gitlab?

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [June 1, 2019, 11:04pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/3 "2019-06-01T23:04:03Z")

</div>

No, I went on to other things hoping that someone would know what I did wrong.

When you say, publishing – I just pushed the repo & then asked for it via npm

Is publishing different?

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [June 1, 2019, 11:29pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/4 "2019-06-01T23:29:57Z")

</div>

> [@ajoslin103](#):
>
> I then published the plugin repo to our in-house gitLab (community edition) repo server

The wording is based on what you said above. Is the package json file on the gitlab server?

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [June 2, 2019, 12:38am UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/5 "2019-06-02T00:38:50Z")

</div>

Ha! And my wording is from the Aureliasite web page on the new cli plugin support 🙂

[https://aurelia.io/docs/plugins/write-new-plugin#structure-of-plugin](https://aurelia.io/docs/plugins/write-new-plugin#structure-of-plugin)

Absolutely it’s there - everything in the file listing that’s not in the .gitignore is there

I went back and re-read the Aureliasite web page on the new cli plugin and they do have a step I skipped ‘#4 npm publish’ but that’s because they show consuming the plugin before that.

When I try the npm publish it tries to push it to [npm.org](http://npm.org) and I can’t have that happen.

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [June 2, 2019, 4:15am UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/6 "2019-06-02T04:15:42Z")

</div>

FYI: package.json has a safe guard `"private": true` to prevent accidental `npm publish` to publish your private package.

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [June 3, 2019, 4:37am UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/7 "2019-06-03T04:37:34Z")

</div>

yep, set to public early on…

Have you been able to publish & consume locally?

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [June 3, 2019, 5:38am UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/8 "2019-06-03T05:38:57Z")

</div>

You don’t need to publish locally. You can consume a npm package from a private github/bitbucket/gitlab repo.

`"package-name": "gitlab:username/repo#tag"`

The down side is you have to update tag (assume you have a tag for every version release) manually to latest version.

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [June 5, 2019, 11:01pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/9 "2019-06-05T23:01:38Z")

</div>

But how is that different from what I did using npm ?

`npm i --save https://git.<ourdomain>.com/ajoslin/my-plugin.git`

you have me adding the line to package.json, and then I’d have to execute npm install to load it - which would then try to pull it

my use of the word: publish doesn’t indicate that I’ve used the ‘npm publish’ command – I was just [imperfectly] using the language of the guide

I’ll try it when I get a chance - but I don’t understand how it’s going to change anything

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [June 5, 2019, 11:22pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/10 "2019-06-05T23:22:40Z")

</div>

You can ignore my suggestion. Your `npm i --save <self-hosted-git-link>` will work, and it will update `package.json` for you.

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [June 5, 2019, 11:42pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/11 "2019-06-05T23:42:41Z")

</div>

but that is the essential problem – my command comes back saying that package.json cannot be found

and both my consuming and publishing repo’s certainly have their package.json files

it’s odd…

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [June 6, 2019, 12:02am UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/12 "2019-06-06T00:02:28Z")

</div>

Check your git server, is package.json file in your repo on server?

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [June 6, 2019, 12:03am UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/13 "2019-06-06T00:03:35Z")

</div>

Another easy test is to goto a clean folder, do a `git clone ...`, then check is there a package.json file inside.

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [August 16, 2019, 8:55pm UTC](https://discourse.aurelia.io/t/solved-error-installing-my-new-first-cli-generated-plugin/2604/14 "2019-08-16T20:55:11Z")

</div>

found the answer here: [https://stackoverflow.com/questions/22988876/install-npm-module-from-gitlab-private-repository](https://stackoverflow.com/questions/22988876/install-npm-module-from-gitlab-private-repository)

I needed to install the plugin with a git+ssh:// prefix to the url – then it works just fine!

`npm install git+ssh://<ssh clone url as copied from our in-house gitlab server>`

This is GREAT!! Plugins Rock!
