当前位置: 首页 > wzjs >正文

fullpage wow做的网站seo社区

fullpage wow做的网站,seo社区,施工企业的定义,wordpress 年索引依赖安装 报错信息: pnpm : 无法加载文件 C:\Users\XXX\AppData\Roaming\npm\pnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID135170 中的 about_Execution_Policies。 所在位置 行:1 …

依赖安装

报错信息:

pnpm : 无法加载文件 C:\Users\XXX\AppData\Roaming\npm\pnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ pnpm install
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

解决办法:

PS D:\code\github\langmanus-web> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

详细根因分析:

命令 `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned` 用于配置 PowerShell 的执行策略,具体含义如下:

**1. 核心功能**
• `-ExecutionPolicy RemoteSigned`:设置执行策略为 RemoteSigned  

  • 本地脚本:允许无限制运行当前用户编写的脚本(如 `.ps1` 文件)。  

  • 远程脚本:要求从互联网下载的脚本必须由受信任的发布者进行数字签名,否则会被阻止执行。  

  • *安全性平衡*:既能满足日常开发需求(运行本地脚本),又避免恶意远程脚本攻击。


• `-Scope CurrentUser`:限定策略生效范围  

  • 仅影响当前用户:策略修改仅对当前登录的 Windows 用户有效,不会影响其他用户或系统全局设置。  

  • *非管理员友好*:无需管理员权限即可完成配置。

**2. 技术细节**
• 持久性:策略会被写入注册表 `HKEY_CURRENT_USER\SOFTWARE\Microsoft\PowerShell\1\ShellIds`,在用户注销或重启后依然有效。

• 优先级规则:  

  • 当多个作用域(如 `LocalMachine` 和 `CurrentUser`)存在冲突策略时,`CurrentUser` 的配置会覆盖全局设置。  

  • 可通过 `Get-ExecutionPolicy -List` 查看所有作用域的优先级顺序。

• 与组策略的关系:若企业通过组策略强制设置了执行策略(如 `MachinePolicy` 或 `UserPolicy`),此命令可能无效。

**3. 典型应用场景**
1. 开发者环境配置  
   • 允许运行本地开发的 PowerShell 脚本(如自动化脚本、CI/CD 工具链)。  

   • 例如安装 Scoop 包管理器时需临时放宽策略限制。


2. 安全受限环境  
   • 在需要限制远程脚本但允许内部脚本的场景中,替代完全开放的 `Unrestricted` 策略。


3. 多用户隔离  
   • 同一台计算机上,不同用户可独立配置策略(如管理员保持严格策略,开发者使用宽松策略)。

**4. 注意事项**
• 权限要求:修改 `CurrentUser` 范围无需管理员权限,但首次操作可能需要用户确认。

• 临时会话策略:若需仅对当前 PowerShell 会话生效(不保存到注册表),可用 `-Scope Process`。

• 恢复默认策略:执行 `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Undefined` 可删除用户级策略。

通过此命令,用户可以在保障安全性的前提下灵活控制脚本执行权限。如需验证当前策略,可运行 `Get-ExecutionPolicy -Scope CurrentUser`。

启动

报错

pnpm dev
❌ Invalid environment variables: { NEXT_PUBLIC_API_URL: [ 'Required' ] }
file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29
        throw new Error("Invalid environment variables");
              ^

Error: Invalid environment variables
    at onValidationError (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29:15)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:35:16)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-nextjs@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12)
    at file:///D:/code/github/langmanus-web/src/env.js:4:20
    at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
    at async loadConfig (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\config.js:964:36)
    at async Module.nextDev (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\cli\next-dev.js:190:14)

Node.js v22.12.0
 ELIFECYCLE  Command failed with exit code 1.

解决方案1:


PS D:\code\github\langmanus-web> echo "NEXT_PUBLIC_API_URL=http://localhost:3000" > .env.local


PS D:\code\github\langmanus-web> pnpm dev
> next dev --turbo

❌ Invalid environment variables: { NEXT_PUBLIC_API_URL: [ 'Required' ] }
file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29
        throw new Error("Invalid environment variables");
              ^

Error: Invalid environment variables
    at onValidationError (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29:15)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:35:16)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-nextjs@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12)
    at file:///D:/code/github/langmanus-web/src/env.js:4:20
    at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
    at async loadConfig (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\config.js:964:36)
    at async Module.nextDev (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\cli\next-dev.js:190:14)

Node.js v22.12.0
 ELIFECYCLE  Command failed with exit code 1.

解决方案2:


PS D:\code\github\langmanus-web> echo NEXT_PUBLIC_API_URL=http://localhost:3000 > .env


PS D:\code\github\langmanus-web> pnpm dev
> langmanus-web@0.1.0 dev D:\code\github\langmanus-web
> next dev --turbo

❌ Invalid environment variables: { NEXT_PUBLIC_API_URL: [ 'Required' ] }
file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29
        throw new Error("Invalid environment variables");
              ^
    at onValidationError (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29:15)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:35:16)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-nextjs@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12)
    at file:///D:/code/github/langmanus-web/src/env.js:4:20
    at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
    at async loadConfig (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\config.js:964:36)
    at async Module.nextDev (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\cli\next-dev.js:190:14)

Node.js v22.12.0
 ELIFECYCLE  Command failed with exit code 1.


解决方案3:


 
PS D:\code\github\langmanus-web> echo "NEXT_PUBLIC_API_URL=http://localhost:3000" > .env.development


PS D:\code\github\langmanus-web> pnpm dev
> next dev --turbo

❌ Invalid environment variables: { NEXT_PUBLIC_API_URL: [ 'Required' ] }
file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29
        throw new Error("Invalid environment variables");
              ^

Error: Invalid environment variables
    at onValidationError (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:29:15)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-core@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js:35:16)
    at createEnv (file:///D:/code/github/langmanus-web/node_modules/.pnpm/@t3-oss+env-nextjs@0.10.1_typescript@5.8.2_zod@3.24.2/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12)
    at file:///D:/code/github/langmanus-web/src/env.js:4:20
    at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
    at async loadConfig (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\config.js:964:36)
    at async Module.nextDev (D:\code\github\langmanus-web\node_modules\.pnpm\next@15.2.2_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\cli\next-dev.js:190:14)

Node.js v22.12.0
 ELIFECYCLE  Command failed with exit code 1.

解决方案4:(有效方案)


PS D:\code\github\langmanus-web> echo NEXT_PUBLIC_API_URL=http://localhost:3000 | Out-File -FilePath .env.local -Encoding UTF8 -NoNewline


PS D:\code\github\langmanus-web> pnpm dev

> langmanus-web@0.1.0 dev D:\code\github\langmanus-web
> next dev --turbo

 ⚠ Port 3000 is in use, trying 3001 instead.
   ▲ Next.js 15.2.2 (Turbopack)
   - Local:        http://localhost:3001
   - Network:      http://10.239.20.117:3001
   - Environments: .env.local, .env.development, .env
   - Experiments (use with caution):
     · turbo

 ✓ Starting...
Slow filesystem detected. If D:\code\github\langmanus-web\.next is a network drive, consider moving it to a local folder. If you have an antivirus enabled, consider excluding your project directory.
 ✓ Ready in 1451ms

命令含义

该命令是一个 PowerShell 脚本命令,用于将环境变量写入 `.env.local` 文件,具体解析如下:

---

**核心功能解析**
1. `echo NEXT_PUBLIC_API_URL=http://localhost:3000`  
   • 通过 `echo` 命令输出字符串 `NEXT_PUBLIC_API_URL=http://localhost:3000`,表示定义环境变量 `NEXT_PUBLIC_API_URL` 并赋值为 `http://localhost:3000`。

   • 该环境变量通常用于前端框架(如 Next.js)中配置 API 基础地址。


2. `| Out-File -FilePath .env.local`  
   • 使用管道符 `|` 将 `echo` 的输出重定向到 `Out-File` 命令,将内容写入 `.env.local` 文件。

   • `.env.local` 是 Next.js 等框架的本地环境变量配置文件,用于存储敏感或开发专用的配置。


3. `-Encoding UTF8`  
   • 指定文件编码为 UTF-8,确保特殊字符(如中文)正确保存。


4. `-NoNewline`  
   • 禁止在文件末尾自动添加换行符,防止因换行符导致环境变量解析错误。


 

http://www.dtcms.com/wzjs/433686.html

相关文章:

  • 厦门网站建设公司排行榜百度广告收费标准
  • 北京建设局投诉网站首页软文代写新闻稿
  • iis 网站建设中营销策划方案模板范文
  • 想在淘宝上找网站建设的靠谱吗大专网络营销专业好不好
  • 郑州建网站seo排名优化软件免费
  • 卫龙的网站做的污污分运营培训班学费大概多少
  • 南阳网站企业网站的作用和意义
  • 查网站备案号今日新闻最新事件
  • 武汉做企业网站网站提交收录软件
  • app开发公司有哪些部门seo网站外链平台
  • 甲公司承担了某市政府门户网站建设项目_与该市信息中心签订了合同app代理推广合作
  • java做网站的步骤西安百度百科
  • 网站推广是怎么做的电商平台有哪些?
  • wordpress 知识库seo网站推广与优化方案
  • 网站建设实用教程被公司优化掉是什么意思
  • 论坛网站模板免费下载百度推广客服人工电话多少
  • 网站优化seo是什么意思站优云网络公司
  • 网页制作教学设计seo的中文意思
  • 丹东城乡建设委员会网站网站测试
  • php网页编辑器百度快速seo优化
  • 阿里巴巴的网站是自己做的吗在线网站seo优化
  • 90设计网站免费素材app拉新推广项目
  • 电脑做网站怎么解析域名图片外链生成器
  • wordpress产品详情页按钮黄山seo推广
  • 二级网站建设百度网络科技有限公司
  • 泰州网站制作工具自己怎么给网站做优化排名
  • 委托广告公司做的网站违法了整站seo排名要多少钱
  • 网站建设属于哪个税收服务编码站长工具域名查询社区
  • 北京建设信源咨询有限公司网站域名服务器ip查询网站
  • wordpress关键字替换石家庄seo网站管理