簡體   English   中英

使用NPM安裝cryptoJS

[英]using NPM to install cryptoJS

我正在嘗試在我的visual studio 2015中安裝cryptoJS。我的npm版本是:4.5.0我的節點版本是:v6.10.2我已經完成:1.通過nuGet安裝Node.js 2.通過nuGet npm安裝

3. npm init --force給出輸出:

npm : npm WARN using --force I sure hope you know what you are doing.
At line:1 char:1
+ npm init --force
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (npm WARN using ... you are doing.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

Wrote to \myProjectPath\package.json:

{
"name": "myProjectName",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"crypto-js": "^3.1.9-1",
"crypto": "^0.0.3",
"node.js": "^0.0.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"

}

我認為輸出無效。 當我嘗試安裝cryptoJS時:

npm install crypto-js

輸出為:

npm : npm WARN MyProjectName@1.0.0 No description
At line:1 char:1
+ npm install crypto-js
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (npm WARN MyProjectName@1.0.0 No description:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

npm
WARN
MyProjectName@1.0.0 No repository field.

我該如何解決? 謝謝

您可能應該測試它是否正常工作。 請使用以下代碼創建一個名為crypto.js的新文件:

var sha256 = require("crypto-js/sha256");
console.log(sha256("Hello"));

然后,使用Node運行它: node crypto.js

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM