Unable to run npm link - hyperlink

I'm trying to develop a yeoman generator
To test my generator locally I need to run npm link
I tried running sudo npm link to no avail.
I have pasted the output of cat npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'link' ]
2 info using npm#2.0.0-alpha-5
3 info using node#v0.10.29
4 verbose node symlink /usr/local/bin/node
5 verbose linkPkg /Users/sourabhshirhatti/ms/yo/generator-aspnet
6 error Error: ENOENT, open '/Users/sourabhshirhatti/ms/yo/generator-aspnet/package.json'
7 error If you need help, you may report this *entire* log,
7 error including the npm and node versions, at:
7 error <http://github.com/npm/npm/issues>
8 error System Darwin 13.3.0
9 error command "node" "/usr/local/bin/npm" "link"
10 error cwd /Users/sourabhshirhatti/ms/yo/generator-aspnet
11 error node -v v0.10.29
12 error npm -v 2.0.0-alpha-5
13 error path /Users/sourabhshirhatti/ms/yo/generator-aspnet/package.json
14 error code ENOENT
15 error errno 34
16 verbose exit [ 34, true ]
Do you folks know how fix this error?

Related

Error in Couldn't find a package.json file during vuepress-Travis CI construction

What can I do?
Here is the code for the part where the problem occurs
error Couldn't find a package.json file in "/home/travis/build/comter1/document"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command "yarn document:build" exited with 1.
$ yarn cname
yarn run v1.22.4
error Couldn't find a package.json file in "/home/travis/build/comter1/document"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command "yarn cname" exited with 1.
cache.2
store build cache
Done. Your build exited with 1
Try changing following in cname.sh file:
echo 'comter1.github.io/document/' > document/.vuepress/dist/CNAME
to
echo 'comter1.github.io/document/' > ./.vuepress/dist/CNAME

Issue with Electron Quick Start Guide

Bonjour
I use
Win 10 (2004)
node 12.16.3
Chrome 85.0.4183.121
Electron 10.1.5.
npm 7.0.8
I follow instructions available here : https://www.electronjs.org/docs/tutorial/quick-start
Everything works fine until paragraph : Package and distribute the application
Indeed, the command :
npx #electron-forge/cli import
returns errors
PS C:\Users\phili\Documents\Temp\TestElectron2> npx #electron-forge/cli import
npm ERR! could not determine executable to run
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\phili\AppData\Local\npm-cache\_logs\2020-11-08T10_52_07_011Z-debug.log
When I open the log file here is what I see
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--',
0 verbose cli '#electron-forge/cli',
0 verbose cli 'import'
0 verbose cli ]
1 info using npm#7.0.8
2 info using node#v15.1.0
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:C:\Users\phili\Documents\Temp\TestElectron2\.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\phili\.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\phili\AppData\Roaming\npm\etc\npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 8ms
19 verbose npm-session ab6a58cdc10c9f54
20 timing npm:load Completed in 19ms
21 http fetch GET 304 https://registry.npmjs.org/#electron-forge%2fcli 1749ms (from cache)
22 timing command:exec Completed in 1768ms
23 verbose stack Error: could not determine executable to run
23 verbose stack at getBinFromManifest (C:\Program Files\nodejs\node_modules\npm\lib\exec.js:241:23)
23 verbose stack at exec (C:\Program Files\nodejs\node_modules\npm\lib\exec.js:158:15)
24 verbose cwd C:\Users\phili\Documents\Temp\TestElectron2
25 verbose Windows_NT 10.0.19041
26 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "exec" "--" "#electron-forge/cli" "import"
27 verbose node v15.1.0
28 verbose npm v7.0.8
29 error could not determine executable to run
30 verbose exit 1
I believe this is a beginner's issue.
Can one of you guide me on the right path?
Best regards, 40tude
I ran into the same issue. I ended up just installing electron-forge and then running import without npx.
npm i -g #electron-forge/cli
electron-forge --version
6.0.0-beta.54
electron-forge import
Just to confirm; I was facing the same issue. As #AndyL has pointed out updating the npm version using npm install -g npm#latest did the trick
I was able to resolve it by:
npm add --include=dev #electron-forge/cli
npx electron-forge import
update: replaced --dev with --include=dev as --dev is now deprecated (ref.: comment from #ManuelMB)
Check your NodeJS version (i had an old version and the same issue).
Only fix npm or try to install with npm i -g #electron-forge/cli won't work.
In my case I had to update NodeJS too.
I had the same error.
I updated my npm ($ npm install -g npm#latest), and then, following the docs for NPM 7 here: https://www.electronforge.io/import-existing-project, the following two commands seemed to work (from project root):
$ npm install --save-dev #electron-forge/cli
$ npm exec --package=#electron-forge/cli -c "electron-forge import"
Worked for me:
npm add --dev #electron-forge/cli
./node_modules/.bin/electron-forge import

Hyperledger Fabric - Commercial Paper tutorial - chaincode instantiate error

I have been following the Commercial Paper tutorial from https://hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html
When I instantiate the chaincode by running the following command
docker exec cliMagnetoCorp peer chaincode instantiate -n papercontract -v 0 -l node -c '{"Args":["org.papernet.commercialpaper:instantiate"]}' -C mychannel -P "AND ('Org1MSP.member')"
I get the following error after a few minutes
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg timeout expired while starting chaincode papercontract:0 for transaction
I have been digging down a bit and it seem the "dev-peer0.org1.example.com-papercontract-0" is failing
dev-peer0.org1.example.com-papercontract-0 logs show the following:
dev-peer0.org1.example.com-papercontract-0|npm ERR! path /usr/local/src/package.json
dev-peer0.org1.example.com-papercontract-0|npm ERR! code ENOENT
dev-peer0.org1.example.com-papercontract-0|npm ERR! errno -2
dev-peer0.org1.example.com-papercontract-0|npm ERR! syscall open
dev-peer0.org1.example.com-papercontract-0|npm ERR! enoent ENOENT: no such file or directory, open '/usr/local/src/package.json'
dev-peer0.org1.example.com-papercontract-0|npm ERR! enoent This is related to npm not being able to find a file.
dev-peer0.org1.example.com-papercontract-0|npm ERR! enoent
dev-peer0.org1.example.com-papercontract-0|
dev-peer0.org1.example.com-papercontract-0|npm ERR! A complete log of this run can be found in:
dev-peer0.org1.example.com-papercontract-0|npm ERR! /root/.npm/_logs/2019-02-08T11_51_20_601Z-debug.log
Have been stuck at it for two days, any help would be greatly appreciated!
Edit: The steps before this run smoothly as expected.
Also the first network simulation (./byfn.sh up) runs perfectly fine.
You need the package.json inside the directory of the chaincode. For example, the chaincode directory name is: ./Chaincode , and inside should be chaincode.js and package.json.
In the package.json, on start, in script you should put "node chaincode.js". That because the peer use npm start to execute the chaincode.

electron-windows-store return error: unknown option `--flatten'

I have tried to make desktop exe for window using electron. I have run below command to generate sign version of exe:
electron-windows-store --input-directory .\\desktop\\dist\\win-unpacked --output-directory .\\desktop\\store --flatten true -a .\\resources\\desktop -m .\\desktop\\assets\\windows\\AppXManifest.xml --package-version 0.0.0.1 --package-name MoodleDesktop
But it give me below error:
> moodledesktop#3.5.1 windows.store D:\wamp64\www\moodle-desktop
> electron-windows-store --input-directory .\desktop\dist\win-unpacked --output-directory .\desktop\store --flatten true -a .\resources\desktop -m .\desktop\assets\windows\AppXManifest.xml --package-version 0.0.0.1 --package-name MoodleDesktop
You need at least Node 4.x to run this script
error: unknown option `--flatten'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! moodledesktop#3.5.1 windows.store: `electron-windows-store --input-directory .\desktop\dist\win-unpacked --output-directory .\desktop\store --flatten true -a .\resources\desktop -m .\desktop\assets\windows\AppXManifest.xml --package-version 0.0.0.1 --package-name VedificDesktop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the moodledesktop#3.5.1 windows.store script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\prawez.musharraf\AppData\Roaming\npm-cache\_logs\2019-02-12T09_50_34_214Z-debug.log
How we resolve this error??
Any help really appriciated.
as from sep 2018 the option flatten been removed
https://github.com/felixrieseberg/electron-windows-store/commit/dcc654df2ec2bb706dc4f1664aa4775ab320541e
that mean just remove it from the command and everything going to be okay!

Ios-deploy install doesn't work - macOS High Sierra (10.13.5)

Command line arguments than I used for ios-deploy.
sudo npm install -g ios-deploy --unsafe-perm --allow-root
Expected behavior
Install ios-deploy global via NPM
Actual behavior.
Ios-deploy not installed and get the error 65:
/bin/sh -c /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
cp: /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices: No such file or directory
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
(1 failure)
npm ERR! code ELIFECYCLE
npm ERR! errno 65
npm ERR! ios-deploy#1.9.2 preinstall: ./src/scripts/check_reqs.js && xcodebuild
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.2 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/vinicius/.npm/_logs/2018-06-20T10_50_13_426Z-debug.log
Steps to reproduce the problem
I run the command: npm install -g ios-deploy
System Specs
system_profiler SPSoftwareDataType
System Version: macOS 10.13.5 (17F77)
Kernel Version: Darwin 17.6.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: Mac mini de Vinicius
User Name: Vinicius Ribeiro (vinicius)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 36 minutes
ios-deploy -V
-bash: ios-deploy: command not found
3. xcodebuild -version
Xcode 9.4.1
Build version 9F2000
4. xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
lldb --version
lldb-902.0.79.7
Swift-4.1
Removed XPCServices file, and the install worked;
https://github.com/ios-control/ios-deploy/issues/346
I know very little about npm install, but I have found that when blocked from an installation on High Sierra, such as when updating ruby gems, a simple solution is to turn off SIP temporarily.

Resources