expo :无法加载文件 D:\Users*user*\AppData\Roaming\npm\expo.ps1,因为在此系统上禁用了运行脚本。有关详细信息,请参阅 https://go.microsoft.com/fwlink/?LinkID=135170 上的 about_Execution_Policies。行:1 字符:1
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Run Code Online (Sandbox Code Playgroud)
我使用 CRA 方法(create-react-app),使用 npm install 为我的项目安装了不同的包,我没有使用其中的很多包,但手动检查项目中未使用哪些包,然后将其删除,这将是一个非常好的方法。困难的过程,有没有办法快速检查哪些包没有在我的项目中使用并删除它们?
我正在开发 Next js 项目,并安装了名为react-firebase-hooks 的包。我的 Package.json 文件:
{
"name": "whatsapp",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"axios": "^0.21.1",
"email-validator": "^2.0.4",
"firebase": "^8.3.1",
"next": "10.1.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-firebase-hooks": "^3.0.3",
"styled-components": "^5.2.2"
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试将其导入 Next js 文件 _app.js 时
import '../styles/globals.css'
import {useAuthState} from "react-firebase-hooks"
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
export default MyApp
Run Code Online (Sandbox Code Playgroud)
但我收到错误:
error - ./pages/_app.js:2:0 …Run Code Online (Sandbox Code Playgroud) 我的版本:
我的 package.json 依赖项
"dependencies": {
"@angular/animations": "~11.2.8",
"@angular/cdk": "^11.2.12",
"@angular/common": "^12.0.3",
"@angular/compiler": "~11.2.8",
"@angular/core": "~11.2.8",
"@angular/forms": "~11.2.8",
"@angular/material": "^11.2.12",
"@angular/platform-browser": "~11.2.8",
"@angular/platform-browser-dynamic": "~11.2.8",
"@angular/router": "~11.2.8",
"@videogular/ngx-videogular": "^3.0.1",
"axios": "^0.21.1",
"bootstrap": "^5.0.0-beta3",
"ng-uikit-pro-standard": "^1.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"video.js": "^7.11.8",
"zone.js": "~0.11.3"
},
Run Code Online (Sandbox Code Playgroud)
当我尝试安装时npm install ngx-toastr --save
npm ERR! Found: @angular/core@11.2.14
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~11.2.8" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"12.0.3" from @angular/common@12.0.3
npm …Run Code Online (Sandbox Code Playgroud) 我正在使用版本 4.5.1 的 dateformat npm 包,并在服务器重新启动时出现错误:
server must be sue import to load ES module
usr/src/app/nodemodules/dateformat/lib/dateformat.js | require() ES module is not supported
Run Code Online (Sandbox Code Playgroud) 我构建了一个 TypeScript 模块并将其推送到 GitHub。我现在想在我的内部使用这个模块MyApp作为依赖项,它也是用 TypeScript 编写的。该包已在我的中注册MyApp/package.json:
"dependencies": {
"foo": "github:organization-xyz/foo",
}
Run Code Online (Sandbox Code Playgroud)
我添加了一个命令build-ts来JavaScript在我的foo模块中创建相应的绑定foo/package.json:
"scripts": {
"build-ts": "tsc"
...
},
Run Code Online (Sandbox Code Playgroud)
当然,当我调用npm i主应用程序时,不会执行该命令。我如何正确准备我的模块foo才能将其成功导入到我的应用程序中?
我已经使用安装了节点版本 14 npm install -g node@14。现在我尝试了以下命令来卸载节点版本 14,但它不起作用。
命令:
$ node -v
v14.19.0
$ npm unisntall node@14
npm WARN saveError ENOENT: no such file or directory, open '/Users/*****/package.json
npm WARN enoent ENOENT: no such file or directory, open '/Users/*****/package.json
npm WARN ***** No description
npm WARN ***** No repository field
npm WARN ***** No README data
npm WARN ***** No license field
up to date in 0.105s
$ node -v
v14.19.0
$ npm uninstall -g node
up to date in …Run Code Online (Sandbox Code Playgroud) 我尝试运行npm run dev并收到此错误:
我试过了:
composer updaterm -rf node_modulesnpm cache cleannpm installnpm outdatednpm installnpm run dev但还是没用。有人能帮我吗?
当我使用sudo npm install命令时出现错误。
usr6783 @ usr6783:〜/ albarakaMobil / client / mobile-branch $ sudo npm install usr6783的[sudo]密码: npm WARN不推荐使用react-native-languages@1.0.7:该项目已重命名为react-native-localize。而是使用react-native-localize安装。 npm WARN不推荐使用node-uuid@1.4.8:改用uuid模块 npm WARN不推荐使用sw-precache@5.2.1:请迁移到Workbox:https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw npm WARN不推荐使用的browserslist@2.11.3:Browserslist 2在读取其他工具中使用的Browserslist> 3.0 config时可能失败。 npm WARN已弃用circular-json@0.3.3:CircularJSON仅在维护中,flatted是其后续版本。 npm WARN不推荐使用sw-toolbox@3.6.0:请迁移到Workbox:https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw npm WARN不推荐使用core-js@1.2.7:不再维护core-js @ <2.6.5。请升级到core-js @ 3或至少升级到实际版本的core-js @ 2。 npm WARN不推荐使用的browserslist@1.7.7:Browserslist 2在读取其他工具中使用的Browserslist> 3.0 config时可能失败。 npm WARN不推荐使用node-uuid@1.3.3:改用uuid模块 npm WARN不推荐使用flatten@1.0.2:我很久以前写了这个模块;您应该使用其他东西。 npm WARN不建议使用的袜子@ 1.1.10:如果使用2.x分支,请升级到至少2.1.6,以避免套接字数据流出现严重的错误以及2.1.0中引入的导入问题 npm ERR!代码1 npm ERR!命令失败:git clone --mirror -q git://github.com/rhdeck/react-native-fix-xcode-10.git /home/usr6783/.npm/_cacache/tmp/git-clone-aa7d6ae5/。吉特 npm ERR!/home/usr6783/.npm/_cacache/tmp/git-clone-aa7d6ae5/.git:权限被拒绝 npm ERR! npm ERR!可以在以下位置找到此运行的完整日志: npm ERR!/home/usr6783/.npm/_logs/2019-05-07T06_12_46_865Z-debug.log
npm-install ×9
node.js ×6
npm ×6
reactjs ×3
react-native ×2
angular ×1
expo ×1
express ×1
firebase ×1
laravel ×1
laravel-8 ×1
next.js ×1
npm-publish ×1
npm-run ×1
npm-scripts ×1
nvm ×1
package ×1
typescript ×1
web ×1