problems installing gulp and pdf.js - javascript

I'm following this and try to use pdf.js. I've downloaded and extracted the library and now I was trying to install gulp globally as it says on the page but when I run the command
C:\Users\xx\Desktop\pdfSearch2>npm install -g gulp-cli
I get errors:
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g"
"gulp-cli"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! unable to get local issuer certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\xx\Desktop\pdfSearch2\npm-debug.log
And here is the full npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'gulp-cli' ]
2 info using npm#3.10.8
3 info using node#v6.9.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData gulp-cli
8 silly fetchNamedPackageData gulp-cli
9 silly mapToRegistry name gulp-cli
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry data Result {
12 silly mapToRegistry raw: 'gulp-cli',
12 silly mapToRegistry scope: null,
12 silly mapToRegistry escapedName: 'gulp-cli',
12 silly mapToRegistry name: 'gulp-cli',
12 silly mapToRegistry rawSpec: '',
12 silly mapToRegistry spec: 'latest',
12 silly mapToRegistry type: 'tag' }
13 silly mapToRegistry uri https://registry.npmjs.org/gulp-cli
14 verbose request uri https://registry.npmjs.org/gulp-cli
15 verbose request no auth needed
16 info attempt registry request try #1 at 8:39:43 AM
17 verbose request id d0dd4dbe0b1dc495
18 http request GET https://registry.npmjs.org/gulp-cli
19 info retry will retry, error on last attempt: Error: unable to get local issuer certificate
20 info attempt registry request try #2 at 8:39:53 AM
21 http request GET https://registry.npmjs.org/gulp-cli
22 info retry will retry, error on last attempt: Error: unable to get local issuer certificate
23 info attempt registry request try #3 at 8:40:53 AM
24 http request GET https://registry.npmjs.org/gulp-cli
25 silly fetchPackageMetaData Error: unable to get local issuer certificate
25 silly fetchPackageMetaData at Error (native)
25 silly fetchPackageMetaData at TLSSocket.<anonymous> (_tls_wrap.js:1062:38)
25 silly fetchPackageMetaData at emitNone (events.js:86:13)
25 silly fetchPackageMetaData at TLSSocket.emit (events.js:185:7)
25 silly fetchPackageMetaData at TLSSocket._finishInit (_tls_wrap.js:586:8)
25 silly fetchPackageMetaData at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38)
25 silly fetchPackageMetaData error for gulp-cli { Error: unable to get local issuer certificate
25 silly fetchPackageMetaData at Error (native)
25 silly fetchPackageMetaData at TLSSocket.<anonymous> (_tls_wrap.js:1062:38)
25 silly fetchPackageMetaData at emitNone (events.js:86:13)
25 silly fetchPackageMetaData at TLSSocket.emit (events.js:185:7)
25 silly fetchPackageMetaData at TLSSocket._finishInit (_tls_wrap.js:586:8)
25 silly fetchPackageMetaData at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38) code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY' }
26 silly rollbackFailedOptional Starting
27 silly rollbackFailedOptional Finishing
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: unable to get local issuer certificate
30 verbose stack at Error (native)
30 verbose stack at TLSSocket.<anonymous> (_tls_wrap.js:1062:38)
30 verbose stack at emitNone (events.js:86:13)
30 verbose stack at TLSSocket.emit (events.js:185:7)
30 verbose stack at TLSSocket._finishInit (_tls_wrap.js:586:8)
30 verbose stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38)
31 verbose cwd C:\Users\xx\Desktop\pdfSearch2
32 error Windows_NT 6.1.7601
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "gulp-cli"
34 error node v6.9.1
35 error npm v3.10.8
36 error code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
37 error unable to get local issuer certificate
38 error If you need help, you may report this error at:
38 error <https://github.com/npm/npm/issues>
39 verbose exit [ 1, true ]
Any idea what I'm doing wrong?
thanks
EDIT: so running this C:\Users\antoniob\Desktop\pdfSearch2>npm config set strict-ssl=false has worked but now I don't seem to be able to install the pdf.js dependencies:
C:\Users\xx\Desktop\pdfSearch2>npm install
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\xx\Desktop\pdfSearch2\package.json'
npm WARN pdfSearch2 No description
npm WARN pdfSearch2 No repository field.
npm WARN pdfSearch2 No README data
npm WARN pdfSearch2 No license field.

I have faced thit issue recently, it can be caused by different reasons.
But usually, it is firewall or proxy behind which is your network that cause this error.
My solution was npm config set strict-ssl=false command which cancels check of the SSL certificates by npm. But be warned that this solution is insecure, it is better to configure your firewall or proxy properly. So after packages installing run npm config set strict-ssl=true command.

Related

Error installing brain.js in Visual Studio Code

newbie here. I had recently switched over to Visual Studio Code to work with Brain.js but when I go to install it into the terminal (With NPM), I get an Error. I have tried multiple other solutions but none work. Any help would be appreciated. Thanx in advance =>
Since I am new also at Linux, I had tried a few variations of install commands(like sudo) and tried to complete the Brain.js installation on Default Linux terminal but to no avail :( . Also a weird thing is that I was able to download BrainJS(Older lib.) but not Brain.js
Even though i don't think there is any problem with the code, Here is it anyways.
const brain = require("brainjs");
let net = new brain.NeuralNetwork({ hiddenLayers: [3] }); //
Setting up neural network
const restaurants = { // Dataset
"KFC":"Monday",
"Item no.1":"Tuesday",
"Vaango":"Wednesday",
"Taco Bell":"Thursday",
"carls Jr.":"Friday",
"":"Saturday",
"Burger King":"Sunday"
}
const TrainingData = [];
for (let restaurantName in restaurants) {
const dayOfWeek = restaurants[restaurantName];
TrainingData.push({
input: { [dayOfWeek]: 1 },
output: { [restaurantName]: 1 }
});
}
const stats = net.train(TrainingData);
THIS IS THE ERROR MSG I AM GETTING:
npm ERR! Linux 5.0.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "brain.js"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG
npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-
package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata
(/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule
(/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:190:5
npm ERR! typeerror at
/usr/share/npm/node_modules/slide/lib/async-map.js:52:35
npm ERR! typeerror at Array.forEach (<anonymous>)
npm ERR! typeerror at
/usr/share/npm/node_modules/slide/lib/async-map.js:52:11
npm ERR! typeerror at Array.forEach (<anonymous>)
npm ERR! typeerror at asyncMap
(/usr/share/npm/node_modules/slide/lib/async-map.js:51:8)
npm ERR! typeerror at exports.loadRequestedDeps (/usr/share/npm/lib/install/deps.js:188:3)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/neel/Documents/VS-Code_Projects/npm-debug.log
AND THE DEBUG LOG:--
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'brain.js' ]
2 info using npm#3.5.2
3 info using node#v8.10.0
4 verbose config Skipping project config: /home/neel/.npmrc. (matches userconfig)
5 silly loadCurrentTree Starting
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 silly fetchPackageMetaData brain.js
9 silly fetchNamedPackageData brain.js
10 silly mapToRegistry name brain.js
11 silly mapToRegistry using default registry
12 silly mapToRegistry registry https://registry.npmjs.org/
13 silly mapToRegistry uri https://registry.npmjs.org/brain.js
14 verbose request uri https://registry.npmjs.org/brain.js
15 verbose request no auth needed
16 info attempt registry request try #1 at 21:59:12
17 verbose request id 74a22560d1b7c23a
18 verbose etag W/"9fb16e14a6b8c1d1ef1c110acba9db6b"
19 verbose lastModified Fri, 09 Aug 2019 11:09:50 GMT
20 http request GET https://registry.npmjs.org/brain.js
21 http 304 https://registry.npmjs.org/brain.js
22 verbose headers { date: 'Tue, 13 Aug 2019 16:29:14 GMT',
22 verbose headers connection: 'keep-alive',
22 verbose headers 'set-cookie':
22 verbose headers [ '__cfduid=d4bf1b2abca3b24131a1907349098099d1565713753; expires=Wed, 12-Aug-20 16:29:13 GMT; path=/; domain=.npmjs.org; HttpOnly' ],
22 verbose headers 'cf-cache-status': 'REVALIDATED',
22 verbose headers 'cache-control': 'max-age=300',
22 verbose headers 'cf-ray': '505c110c8bc58a5f-BOM',
22 verbose headers etag: '"9fb16e14a6b8c1d1ef1c110acba9db6b"',
22 verbose headers 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
22 verbose headers 'last-modified': 'Fri, 09 Aug 2019 11:09:50 GMT',
22 verbose headers vary: 'accept-encoding, accept',
22 verbose headers 'x-amz-meta-rev': '67-25f3ef5cf61222403c910fbd6b789aa9',
22 verbose headers server: 'cloudflare' }
23 silly get cb [ 304,
23 silly get { date: 'Tue, 13 Aug 2019 16:29:14 GMT',
23 silly get connection: 'keep-alive',
23 silly get 'set-cookie':
23 silly get [ '__cfduid=d4bf1b2abca3b24131a1907349098099d1565713753; expires=Wed, 12-Aug-20 16:29:13 GMT; path=/; domain=.npmjs.org; HttpOnly' ],
23 silly get 'cf-cache-status': 'REVALIDATED',
23 silly get 'cache-control': 'max-age=300',
23 silly get 'cf-ray': '505c110c8bc58a5f-BOM',
23 silly get etag: '"9fb16e14a6b8c1d1ef1c110acba9db6b"',
23 silly get 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
23 silly get 'last-modified': 'Fri, 09 Aug 2019 11:09:50 GMT',
23 silly get vary: 'accept-encoding, accept',
23 silly get 'x-amz-meta-rev': '67-25f3ef5cf61222403c910fbd6b789aa9',
23 silly get server: 'cloudflare' } ]
24 verbose etag https://registry.npmjs.org/brain.js from cache
25 verbose get saving brain.js to /home/neel/.npm/registry.npmjs.org/brain.js/.cache.json
26 silly install normalizeTree
27 silly loadCurrentTree Finishing
28 silly loadIdealTree Starting
29 silly install loadIdealTree
30 silly cloneCurrentTree Starting
31 silly install cloneCurrentTreeToIdealTree
32 silly cloneCurrentTree Finishing
33 silly loadShrinkwrap Starting
34 silly install loadShrinkwrap
35 silly loadShrinkwrap Finishing
36 silly loadAllDepsIntoIdealTree Starting
37 silly install loadAllDepsIntoIdealTree
38 verbose stack Error: Missing required argument #1
38 verbose stack at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
38 verbose stack at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
38 verbose stack at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
38 verbose stack at /usr/share/npm/lib/install/deps.js:190:5
38 verbose stack at /usr/share/npm/node_modules/slide/lib/async-map.js:52:35
38 verbose stack at Array.forEach (<anonymous>)
38 verbose stack at /usr/share/npm/node_modules/slide/lib/async-map.js:52:11
38 verbose stack at Array.forEach (<anonymous>)
38 verbose stack at asyncMap (/usr/share/npm/node_modules/slide/lib/async-map.js:51:8)
38 verbose stack at exports.loadRequestedDeps (/usr/share/npm/lib/install/deps.js:188:3)
39 verbose cwd /home/neel/Documents/VS-Code_Projects
40 error Linux 5.0.0-23-generic
41 error argv "/usr/bin/node" "/usr/bin/npm" "install" "brain.js"
42 error node v8.10.0
43 error npm v3.5.2
44 error code EMISSINGARG
45 error typeerror Error: Missing required argument #1
45 error typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
45 error typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
45 error typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
45 error typeerror at /usr/share/npm/lib/install/deps.js:190:5
45 error typeerror at /usr/share/npm/node_modules/slide/lib/async-map.js:52:35
45 error typeerror at Array.forEach (<anonymous>)
45 error typeerror at /usr/share/npm/node_modules/slide/lib/async-map.js:52:11
45 error typeerror at Array.forEach (<anonymous>)
45 error typeerror at asyncMap (/usr/share/npm/node_modules/slide/lib/async-map.js:51:8)
45 error typeerror at exports.loadRequestedDeps (/usr/share/npm/lib/install/deps.js:188:3)
46 error typeerror This is an error with npm itself. Please report this error at:
46 error typeerror <http://github.com/npm/npm/issues>
47 verbose exit [ 1, true ]
You state:
Error installing brain.js
But when you go to install require it, you are using "brainjs", not "brain.js":
const brain = require("brainjs");
You are referencing two different libraries, though different by one character. Use this:
const brain = require('brain.js');
npm ERR! npm v3.5.2
As discussed in the comments, this is an old version of NPM and the solution was to update to a newer version.

Failed to exec start script when running npm start

I am receiving this error when trying to start my node application using the npm start command.
From log
10 verbose lifecycle #~start: CWD: F:\reactjs
11 silly lifecycle #~start: Args: [ '/d /s /c', 'webpack-dev-server --hot' ]
12 silly lifecycle #~start: Returned: code: 4294967295 signal: null
13 info lifecycle #~start: Failed to exec start script
14 verbose stack Error: # start: webpack-dev-server --hot
14 verbose stack Exit status 4294967295
14 verbose stack at EventEmitter. (E:\Program
Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (E:\Program
Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:920:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
15 verbose pkgid #
16 verbose cwd F:\reactjs
17 error Windows_NT 10.0.10586
18 error argv "E:\Program Files\nodejs\node.exe" "E:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
19 error node v6.11.3
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error # start: webpack-dev-server --hot
22 error Exit status 4294967295
23 error Failed at the # start script 'webpack-dev-server --hot'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error webpack-dev-server --hot
23 error You can get information on how to open an issue for this project with:
23 error npm bugs
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls
23 error There is likely additional logging output above.
Your issue is in your webpack configuration.
The line that gives you this error is line 4
Configuration file found but no entry configured
This might help:
Webpack configuration file found but no entry configured
here is the docs on webpack for entry: https://webpack.github.io/docs/configuration.html#entry

npm won't install forked git repo

trying to install a forked version of ng2-smart-table for my app but npm is not doing it.
I've used
npm install git+http://github.com/myusername/ng2-smart-table.git
npm install git://github.com/myusername/ng2-smart-table.git
npm install github.com/myusername/ng2-smart-table
and many other variations. I get the following error.
npm ERR! addLocal Could not install /tmp/npm-24904-e690204a/git-cache-97763c70/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
npm ERR! Linux 3.10.0-693.5.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "git://github.com/myusername/ng2-smart-table.git"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! No version provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/myname/my-app/npm-debug.log
[root#stackc-pre-staging my-app]# vim /home/myname/my-app/npm-debug.log
[root#stackc-pre-staging my-app]# npm install git+http://github.com/myusername/ng2-smart-table.git
npm ERR! addLocal Could not install /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
npm ERR! Linux 3.10.0-693.5.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "git+http://github.com/myusername/ng2-smart-table.git"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! No version provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/myname/my-app/npm-debug.log
Contents of /home/myname/my-app/npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli 'git+http://github.com/myusername/ng2-smart-table.git' ]
2 info using npm#3.10.10
3 info using node#v6.11.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData git+http://github.com/myusername/ng2-smart-table.git
8 silly fetchOtherPackageData git+http://github.com/myusername/ng2-smart-table.git
9 silly cache add args [ 'git+http://github.com/myusername/ng2-smart-table.git', null ]
10 verbose cache add spec git+http://github.com/myusername/ng2-smart-table.git
11 silly cache add parsed spec Result {
11 silly cache add raw: 'git+http://github.com/myusername/ng2-smart-table.git',
11 silly cache add scope: null,
11 silly cache add escapedName: null,
11 silly cache add name: null,
11 silly cache add rawSpec: 'git+http://github.com/myusername/ng2-smart-table.git',
11 silly cache add spec: 'http://github.com/myusername/ng2-smart-table.git',
11 silly cache add type: 'git' }
12 verbose addRemoteGit caching git+http://github.com/myusername/ng2-smart-table.git
13 silly tryClone cloning git+http://github.com/myusername/ng2-smart-table.git via git+http://github.com/myusername/ng2-smart-table.git
14 verbose tryClone git-http-github-com-myusername-ng2-smart-table-git-6513bc33 not in flight; caching
15 verbose correctMkdir /root/.npm/_git-remotes correctMkdir not in flight; initializing
16 info git [ 'clone',
16 info git '--template=/root/.npm/_git-remotes/_templates',
16 info git '--mirror',
16 info git 'http://github.com/myusername/ng2-smart-table.git',
16 info git '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33' ]
17 verbose mirrorRemote git+http://github.com/myusername/ng2-smart-table.git git clone http://github.com/myusername/ng2-smart-table.git Cloning into bare repository '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33'...
18 verbose correctMkdir /root/.npm/_git-remotes correctMkdir not in flight; initializing
19 verbose setPermissions git+http://github.com/myusername/ng2-smart-table.git set permissions on /root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33
20 verbose resolveHead git+http://github.com/myusername/ng2-smart-table.git original treeish: master
21 info git [ 'rev-list', '-n1', 'master' ]
22 silly resolveHead git+http://github.com/myusername/ng2-smart-table.git resolved treeish: bb5d603024d75ce8a664d949a646ca7c7c29b0a0
23 verbose resolveHead git+http://github.com/myusername/ng2-smart-table.git resolved Git URL: git+ssh://git#github.com/myusername/ng2-smart-table.git#bb5d603024d75ce8a664d949a646ca7c7c29b0a0
24 silly resolveHead Git working directory: /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
25 info git [ 'clone',
25 info git '/root/.npm/_git-remotes/git-http-github-com-myusername-ng2-smart-table-git-6513bc33',
25 info git '/tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0' ]
26 verbose cloneResolved git+http://github.com/myusername/ng2-smart-table.git clone Cloning into '/tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0'...
26 verbose cloneResolved done.
27 info git [ 'checkout', 'bb5d603024d75ce8a664d949a646ca7c7c29b0a0' ]
28 verbose checkoutTreeish git+http://github.com/myusername/ng2-smart-table.git checkout Note: checking out 'bb5d603024d75ce8a664d949a646ca7c7c29b0a0'.
28 verbose checkoutTreeish
28 verbose checkoutTreeish You are in 'detached HEAD' state. You can look around, make experimental
28 verbose checkoutTreeish changes and commit them, and you can discard any commits you make in this
28 verbose checkoutTreeish state without impacting any branches by performing another checkout.
28 verbose checkoutTreeish
28 verbose checkoutTreeish If you want to create a new branch to retain commits you create, you may
28 verbose checkoutTreeish do so (now or later) by using -b with the checkout command again. Example:
28 verbose checkoutTreeish
28 verbose checkoutTreeish git checkout -b new_branch_name
28 verbose checkoutTreeish
28 verbose checkoutTreeish HEAD is now at bb5d603... Added a show/hide variable to column settings so that you can toggle visibility of columns
29 info git [ 'submodule', '-q', 'update', '--init', '--recursive' ]
30 verbose updateSubmodules git+http://github.com/myusername/ng2-smart-table.git submodule update
31 error addLocal Could not install /tmp/npm-25075-02c22b92/git-cache-ba6c0ee9/bb5d603024d75ce8a664d949a646ca7c7c29b0a0
32 silly fetchPackageMetaData Error: No version provided in package.json
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
32 silly fetchPackageMetaData at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
32 silly fetchPackageMetaData at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
32 silly fetchPackageMetaData at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
32 silly fetchPackageMetaData at tryToString (fs.js:456:3)
32 silly fetchPackageMetaData at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
32 silly fetchPackageMetaData error for git+http://github.com/myusername/ng2-smart-table.git Error: No version provided in package.json
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
32 silly fetchPackageMetaData at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
32 silly fetchPackageMetaData at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
32 silly fetchPackageMetaData at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
32 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
32 silly fetchPackageMetaData at tryToString (fs.js:456:3)
32 silly fetchPackageMetaData at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
33 silly rollbackFailedOptional Starting
34 silly rollbackFailedOptional Finishing
35 silly runTopLevelLifecycles Finishing
36 silly install printInstalled
37 verbose stack Error: No version provided in package.json
37 verbose stack at /usr/lib/node_modules/npm/lib/cache/add-local.js:73:17
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:356:5
37 verbose stack at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:320:45)
37 verbose stack at final (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:354:3)
37 verbose stack at then (/usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:124:5)
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/read-package-json/read-json.js:243:12
37 verbose stack at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/graceful-fs.js:78:16
37 verbose stack at tryToString (fs.js:456:3)
37 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
38 verbose cwd /home/myname/my-app
39 error Linux 3.10.0-693.5.2.el7.x86_64
40 error argv "/usr/bin/node" "/usr/bin/npm" "install" "git+http://github.com/myusername/ng2-smart-table.git"
41 error node v6.11.1
42 error npm v3.10.10
43 error No version provided in package.json
44 error If you need help, you may report this error at:
44 error <https://github.com/npm/npm/issues>
45 verbose exit [ 1, true ]
Is this a permissions issue? Or is there something wrong with the way npm is set up? Any help would be appreciated.
Try recreating package.json for that repo with npm init . command and go through all the steps.
Remember having correct repository link in the repository section.
I had the same problem but above helped.
Problem 1: The repo on your post does not exist.
You might've used the wrong repo url.
Use the correct repo url: https://github.com/akveo/ng2-smart-table
Problem 2: The repo does not have a version specified in the package.json
Just fork it and add a version in the package.json file.
Or, use the npm version,
npm install --save ng2-smart-table

npm install -g . doesn't copy, fails

The npm developer docs say to make sure your package installs globally before publishing by running npm install -g .. I'm trying to build an ES6 CLI package that can be installed and run globally, but after running Babel to transpile it (with the es2015 plugin), the global install on my machine fails.
I've created a simple demo ES6 project that reproduces the error. Cloning and running npm install -g . throws the error in the README:
$ npm install -g .
> es6-test#0.0.1 prepublish /Users/me/dev/es6-test
> npm run build
> es6-test#0.0.1 build /Users/me/dev/es6-test
> babel --out-dir es5/ src/
src/bin/app.js -> es5/bin/app.js
src/core/location.js -> es5/core/location.js
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.4.0/bin/node" "/usr/local/bin/npm" "install" "-g" "."
npm ERR! node v5.4.0
npm ERR! npm v3.3.12
npm ERR! path /usr/local/lib/node_modules/es6-test/es5/bin/app
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/es6-test/es5/bin/app'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/me/dev/es6-test/npm-debug.log
Am I doing something wrong? I've tried a few different commands, with both Babel and NPM, but ultimately nothing seems to get copied into /usr/local/lib/node_modules.
$ node -v
v5.4.0
$ npm -v
3.3.12
EDIT: The error appears to be the same with the latest node and v0.10.24, with and without sudo. The logfile says:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/5.4.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'i',
1 verbose cli '-g',
1 verbose cli '.gs' ]
2 info using npm#3.3.12
3 info using node#v5.4.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData .gs
8 silly fetchOtherPackageData .gs
9 silly cache add args [ '.gs', null ]
10 verbose cache add spec .gs
11 silly cache add parsed spec Result {
11 silly cache add raw: '.gs',
11 silly cache add scope: null,
11 silly cache add name: null,
11 silly cache add rawSpec: '.gs',
11 silly cache add spec: '/Users/me/dev/es6-test/.gs',
11 silly cache add type: 'local' }
12 error addLocal Could not install /Users/me/dev/es6-test/.gs
13 silly fetchPackageMetaData Error: ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs'
13 silly fetchPackageMetaData at Error (native)
13 silly fetchPackageMetaData error for .gs { [Error: ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs']
13 silly fetchPackageMetaData errno: -2,
13 silly fetchPackageMetaData code: 'ENOENT',
13 silly fetchPackageMetaData syscall: 'open',
13 silly fetchPackageMetaData path: '/Users/me/dev/es6-test/.gs' }
14 silly rollbackFailedOptional Starting
15 silly rollbackFailedOptional Finishing
16 silly runTopLevelLifecycles Starting
17 silly runTopLevelLifecycles Finishing
18 silly install printInstalled
19 verbose stack Error: ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs'
19 verbose stack at Error (native)
20 verbose cwd /Users/me/dev/es6-test
21 error Darwin 14.5.0
22 error argv "/usr/local/Cellar/node/5.4.0/bin/node" "/usr/local/bin/npm" "i" "-g" ".gs"
23 error node v5.4.0
24 error npm v3.3.12
25 error path /Users/me/dev/es6-test/.gs
26 error code ENOENT
27 error errno -2
28 error syscall open
29 error enoent ENOENT: no such file or directory, open '/Users/me/dev/es6-test/.gs'
29 error enoent This is most likely not a problem with npm itself
29 error enoent and is related to npm not being able to find a file.
30 verbose exit [ -2, true ]
The "bin" property of the package.json points to an app.js file in es5/bin but there is no app.js file. You'll need to point it to the csp.js file:
package.json
"bin": {
"csp": "es5/bin/csp.js"
},

Can't start Node js server in the example application of Angular

I downloaded Angular phonecat example phoject, moved to this directory and tried 'npm start' command. Result:
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/Cellar/nvm/0.17.2/v0.10.32/bin/npm',
1 verbose cli 'start' ]
2 info using npm#2.1.4
3 info using node#v0.10.32
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart angular-phonecat#0.0.0
6 verbose unsafe-perm in lifecycle true
7 info angular-phonecat#0.0.0 Failed to exec prestart script
8 verbose stack Error: angular-phonecat#0.0.0 prestart: `npm install`
8 verbose stack Exit status 3
8 verbose stack at ChildProcess.<anonymous> (/usr/local/Cellar/nvm/0.17.2/v0.10.32/lib/node_modules/npm/lib/utils/lifecycle.js:212:16)
8 verbose stack at ChildProcess.emit (events.js:98:17)
8 verbose stack at maybeClose (child_process.js:756:16)
8 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:823:5)
9 verbose pkgid angular-phonecat#0.0.0
10 verbose cwd /Users/marya/JS:HTML:CSS/angular-phonecat
11 error Darwin 13.4.0
12 error argv "node" "/usr/local/Cellar/nvm/0.17.2/v0.10.32/bin/npm" "start"
13 error node v0.10.32
14 error npm v2.1.4
15 error code ELIFECYCLE
16 error angular-phonecat#0.0.0 prestart: `npm install`
16 error Exit status 3
17 error Failed at the angular-phonecat#0.0.0 prestart script.
17 error This is most likely a problem with the angular-phonecat package,
17 error not with npm itself.
17 error Tell the author that this fails on your system:
17 error npm install
17 error You can get their info via:
17 error npm owner ls angular-phonecat
17 error There is likely additional logging output above.
18 verbose exit [ 1, true ]
I don't understand why but I can't execute server. How can I fix it? Thanks in advance.
It seems node is installed with version node#v0.10.32
Anyhow, what really happens is that npm looks in your package.json file, and if you have something like
"scripts": { "start": "coffee server.coffee" } }
then it will do that. If npm can't find your start script, it will not work
try node start using
node <name of your node server>.js
and error seen in your angular-phonecat Try reinstalling it using npm command and try.

Categories