GVKun编程网logo

无法使用npm安装prerender-“无法找到:CL.exe”(无法使用此安装程序来安装)

11

本文将介绍无法使用npm安装prerender-“无法找到:CL.exe”的详细情况,特别是关于无法使用此安装程序来安装的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,

本文将介绍无法使用npm安装prerender-“无法找到:CL.exe”的详细情况,特别是关于无法使用此安装程序来安装的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也将涉及一些关于exec.Command(“ date”)无法找到日期命令、Fresh Red Hat Enterprise Linux无法使用yum安装httpd、html5 – shasum检查无法使用npm安装手机间隙、java – Springboot @ServerEndPoint“无法找到根WebApplicationContext.”的知识。

本文目录一览:

无法使用npm安装prerender-“无法找到:CL.exe”(无法使用此安装程序来安装)

无法使用npm安装prerender-“无法找到:CL.exe”(无法使用此安装程序来安装)

我一直在尝试PreRender.Io在本地计算机上安装进行测试。我已经安装了Python 2.7.10。当我键入:

npm install prerender

它给出一个错误:

C:\PreRender\node_modules\prerender\node_modules\phantom\node_modules\dnode\node_modules\weak>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js"rebuild )  else (node  rebuild )Building the projects in this solution one at a time. To enable parallel build,please add the "/m" switch.TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\PreRender\node_modules\prerender\node_modules\phantom\node_modules\dnode\node_modules\weak\build\weakref.vcxproj]gyp ERR! build errorgyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)gyp ERR! stack     at ChildProcess.emit (events.js:110:17)gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)gyp ERR! System Windows_NT 6.1.7601

我找不到CL.exe,在Google上进行的快速搜索似乎缺少了一些Visual C 编译器。但是,我尝试安装说VC
2008可再发行的x86,但仍然是同样的问题。

知道有什么问题吗?操作系统是Windows 7 64位。

答案1

小编典典

我设法解决了这个问题,尽管这很奇怪。老实说,我不确定是哪一个完全解决了问题,因为我做了很多工作。我已经在计算机上安装了Visual Studio
2015。以下是我所做的摘要:

  • 安装 Visual C ++编译 ,从VS 2015安装。默认情况下,它是未选中的。我认为这就是解决此问题的原因。

  • CL.exe (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin)stdlib.h 所在的路径添加(C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include)PATH 环境变量中。

  • npm install prerenderDeveloper Command Prompt* Visual Studio 2015 的in中执行,以 管理员模式 运行 *

exec.Command(“ date”)无法找到日期命令

exec.Command(“ date”)无法找到日期命令

package main

import (    "fmt"    "log"    "os/exec")func main() {    out, err := exec.Command("date").Output()    if err != nil {        log.Fatal(err)    }    fmt.Printf("The date is %s\n", out)}

这是文档中用于执行系统命令的代码示例。http://golang.org/pkg/os/exec/#example_Cmd_Output即使在文档站点上,示例执行框也不运行,并且具有相同的错误:
2009/11/10 23:00:00 exec:“ date” :在$ PATH中找不到可执行文件

在Windows上,我得到:exec:“ date”:在%PATH%中找不到可执行文件

如何使命令起作用?我是否需要设置路径或写出命令的完整路径?

答案1

小编典典

令人遗憾的是,除非您date.exe从某个地方(Cygwin?)得到一个并放入您的中,否则该示例将对您不起作用%PATH%

我相信这date是Powershell中的内置功能。它对您有用,因为您的外壳正在解释它。

您可能能够做到

out, err := exec.Command("cmd", "/C", "date").Output()

边注:

Get-Command日期说“术语’date’不被识别为cmdlet的名称”

该词组有两个Google结果。其中之一使我想到了这一点,这有助于我弄清楚这一点。

Fresh Red Hat Enterprise Linux无法使用yum安装httpd

Fresh Red Hat Enterprise Linux无法使用yum安装httpd

我正在尝试在新的红帽服务器中安装LAMP堆栈,但是yum行为不端.作为 Linux的文盲我不知所措.
$yum install httpd
Loaded plugins: security
Setting up Install Process
No package httpd available.
nothing to do

我的yum配置

$cat /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1 

# Note: yum-RHN-plugin doesn't honor this.
Metadata_expire=1h

# Default.
# installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

yum.repos.d目录中的其他内容

$ls -lah /etc/yum.repos.d/
total 12K
drwxr-xr-x  2 root root 4.0K Feb  4 01:15 .
drwxr-xr-x 59 root root 4.0K Feb  4 01:28 ..
-rw-r--r--  1 root root  561 Mar 10  2010 rhel-debuginfo.repo

会发生什么事?我认为“开箱即用”RHEL5.5会更友好:)

解决方法

我想到了.由于此服务器是使用云中的图像自动创建的,因此从未在红帽网络中注册.在这之后,yum开始再次表现.

html5 – shasum检查无法使用npm安装手机间隙

html5 – shasum检查无法使用npm安装手机间隙

我已经尝试了很多次但仍然出现此错误(shasum检查失败)
4784 error Error: shasum check Failed for C:\Users\FENGXI~1\AppData\Local\Temp\npm-7004-QbpFFte5\1387269030233-0.28223602287471294\tmp.tgz
4784 error Expected: dee5a33ff04d7217194dc1ad1342e3a441761942
4784 error Actual:   ab7d89ca1f31db14db047d01222dd968649cfb50
4784 error     at C:\Program Files\nodejs\node_modules\npm\node_modules\sha\index.js:38:8
4784 error     at ReadStream.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\sha\index.js:85:7)
4784 error     at ReadStream.EventEmitter.emit (events.js:117:20)
4784 error     at _stream_readable.js:920:16
4784 error     at process._tickCallback (node.js:415:13)
4785 error If you need help,you may report this *entire* log,4785 error including the npm and node versions,at:
4785 error     <http://github.com/isaacs/npm/issues>
4786 error System Windows_NT 6.1.7600
4787 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
4788 error cwd D:\environment\phonegap
4789 error node -v v0.10.23
4790 error npm -v 1.3.17

解决方法

解决这个问题的根本原因是固定的.请不要接受这个主题中的建议并且总是破解校验和错误.如果某些东西有一个破坏的校验和,那就不值得信赖了.它充其量只是破碎了;在最坏的情况下,它被恶意攻击.无论哪种方式,这都不是一个好兆头,错误是系统工作.

java – Springboot @ServerEndPoint“无法找到根WebApplicationContext.”

java – Springboot @ServerEndPoint“无法找到根WebApplicationContext.”

我在使用带有@ServerEndPoint注释类的spring时遇到了麻烦

我正在使用Springboot 1.2.3,我正试图弄清楚如何拥有一个端点的单个实例

@SpringBootApplication
@EnableJpaRepositories
@EnableWebSocket
public class ApplicationServer {
    public static void main(String[] args) {
        SpringApplication.run(ApplicationServer.class,args);
    }
}

弹簧配置:

@ConditionalOnWebApplication
@Configuration
public class WebSocketConfigurator {

    @Bean
    public ServerEndPoint serverEndpoint() {
        return new ServerEndPoint();
    }

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}

WebSocket端点:

@ServerEndpoint(value = "/",decoders = MessageDecoder.class,encoders = MessageEncoder.class,configurator = SpringConfigurator.class)
public class ServerEndPoint {

    private static final Logger LOG = LoggerFactory.getLogger(ServerEndPoint.class);

    public static final Set

这是基于Spring WebSocket JSR-356 tutorial,但我有以下错误:

java.lang.IllegalStateException: Failed to find the root WebApplicationContext. Was ContextLoaderListener not used?
    at org.springframework.web.socket.server.standard.SpringConfigurator.getEndpointInstance(SpringConfigurator.java:68)
    at org.apache.tomcat.websocket.pojo.PojoEndpointServer.onopen(PojoEndpointServer.java:50)
    at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

我已经在嵌入模式和外部tomcat 8和jetty 9中进行了测试(在外部模式下,我删除了de Spring配置文件)但出现了同样的错误.

the only workaround i’ve found is to create a custom configurator.

public class SpringEndpointConfigurator extends ServerEndpointConfig.Configurator {

    private static WebApplicationContext wac;

    public SpringEndpointConfigurator() {
    }

    public SpringEndpointConfigurator(WebApplicationContext wac) {
        SpringEndpointConfigurator.wac = wac;
    }

    @Override
    public beanfactory().getBean(endpointClass);
        return (endPoint != null) ? endPoint : wac.getAutowireCapablebeanfactory().createBean(endpointClass);
    }

它是使用参数化构造函数创建的@Bean.

我一定错过了使用SpringConfigurator类完成它的东西,但我不知道是什么.

最佳答案
SpringConfigurator使用ContextLoader来获取spring上下文. Spring Boot确实设置了ServletContext,但它从不使用ContextLoaderListener来初始化ContextLoader来保存spring上下文的静态.您可以尝试添加ContextLoaderListener,或者作为一种解决方法,您可以编写自己的上下文持有者和配置程序.

这是一个例子:

第一个上下文持有者和配置者:

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.beanfactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import javax.websocket.server.ServerEndpointConfig;

public class CustomSpringConfigurator extends ServerEndpointConfig.Configurator implements ApplicationContextAware {

    /**
     * Spring application context.
     */
    private static volatile beanfactory context;

    @Override
    public figurator.context = applicationContext;
    }
}

要获取上下文,我们需要将其配置为Bean:

@ConditionalOnWebApplication
@Configuration
public class WebSocketConfigurator {

...

    @Bean
    public CustomSpringConfigurator customSpringConfigurator() {
        return new CustomSpringConfigurator(); // This is just to get context
    }
}

然后你需要正确设置配置器:

@ServerEndpoint(value = "/",configurator = CustomSpringConfigurator.class)
public class ServerEndPoint {
...
}

作为旁注,是的,如果删除SpringConfigurator,您的应用程序将启动,您可以处理请求.但是你不能自动装配其他bean.

今天关于无法使用npm安装prerender-“无法找到:CL.exe”无法使用此安装程序来安装的讲解已经结束,谢谢您的阅读,如果想了解更多关于exec.Command(“ date”)无法找到日期命令、Fresh Red Hat Enterprise Linux无法使用yum安装httpd、html5 – shasum检查无法使用npm安装手机间隙、java – Springboot @ServerEndPoint“无法找到根WebApplicationContext.”的相关知识,请在本站搜索。

本文标签: